Oxygen Basic

Programming => Example Code => General => Topic started by: Charles Pegge on February 01, 2014, 09:20:38 AM

Title: Multi-Assign with arrays of compound type
Post by: Charles Pegge on February 01, 2014, 09:20:38 AM
Using inner brackets enables structures to be partially filled with data:

Required Oxygen update: (31 Jan 2014)
http://www.oxygenbasic.org/forum/index.php?topic=749.0

Code: [Select]
includepath "$/inc/"
include "console.inc"

def printl print cr

type item
  string n
  single x,y,z
end type

item v[]={ {"one",1},{"two",2},{"three",3,30,300} }

for j=1 to 3
  printl v[j].n tab v[j].x tab v[j].y tab v[j].z
next
printl
WaitKey
Title: Re: Multi-Assign with arrays of compound type
Post by: Emil_halim on February 01, 2014, 09:41:18 AM
 Hi Charles,

again nice C_style approach.

i think this example must move to C_Code folder?   
Title: Re: Multi-Assign with arrays of compound type
Post by: Charles Pegge on February 01, 2014, 10:04:29 AM
I'm currently filing these examples to examples/Constructs