rene
It is just a content of array ...
try this one:
so ,as you see is very clear what it is,right?INT arr[5] arr[q] <= (1,2,3,4,5) print str arr[2] ' show 2
I'm trying to understand and learn - but my brains are old, rusty and stuffed with loads of useless knowledge, that's why I still did not get it.
I know this "<=" as some comparison-operator. If it's used to assign values it would be enough to use just "=".
So does this assign the values to the array ordered from smallest to largest or what?
Or does it assign only values if the original value of the variable is smaller than the new one?
or is it just supposed to symbolize an arrow as "->" in some older c-dialect?
Edit: hours later ...does it mean to assign the count of elements to the variable enclosed in brackets?
Last edited by ReneMiner; 21-07-2013 at 08:41.
I think there are missing some Forum-sections as beta-testing and support
rene
It is just a content of array ...
try this one:
so ,as you see is very clear what it is,right?INT arr[5] arr[q] <= (1,2,3,4,5) print str arr[2] ' show 2
I tried this:
Output:Uses "oxygen" String src = RawText ' #basic ' Int arr[5] Int q arr[q] <= (1,2,3,4,5) Print str arr[2] ' show 2 Print str q ' terminate ' End RawText O2_BASIC src If Len(O2_ERROR) Then MsgBox 0, O2_ERROR : Stop End If O2_EXEC
3
0
???
Now I'm speechless
I think there are missing some Forum-sections as beta-testing and support
'<=' is use a multi-assign operator. Oxygen also accepts '=>' as used by Freebasic. Curly braces are also accepted:
long a[5]={1,2,3,4,5}
The reason for this flexi-syntax is to support clean layouts of data, including tabulations:
dim as long a[16] ... 'no need for brackets here a=> 1, 2, 3, 4, 2, 4, 6, 8, 3, 6, 9,12, 4, 8,12,16
Last edited by Charles Pegge; 21-07-2013 at 09:08.
Aurel, Rene,
Correction here: Oxygen static arrays are dimensioned at compile-time. So the number of elements must be a constant. The new version will report the error.
%q=5
arr[q] <= (1,2,3,4,5)
Last edited by Charles Pegge; 21-07-2013 at 09:23.
strange: twice nearly the same content
the above results wrongUses "oxygen" String src = RawText ' #basic ' %q = 5 Int arr[q] arr[q] <= (1,2,3,4,5) Print str arr[2] ' show 2 Print str q terminate ' End RawText O2_BASIC src If Len(O2_ERROR) Then MsgBox 0, O2_ERROR : Stop End If O2_EXEC
this one seems correct.Uses "oxygen" String src = RawText ' #basic ' %q = 5 Int arr[q] <= (1,2,3,4,5) Print str arr[2] ' show 2 Print str q terminate ' End RawText O2_BASIC src If Len(O2_ERROR) Then MsgBox 0, O2_ERROR : Stop End If O2_EXEC
So the <= just means "populate the array"
Edit: I also had a few basic questions - already posted here
Last edited by ReneMiner; 21-07-2013 at 09:52.
I think there are missing some Forum-sections as beta-testing and support
Charles ...
i know the quirks..
Rene
I use Oxygen directly ,not trough thinBasic
Bookmarks