Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Oxygen within thinBasic - some Feedback

  1. #11
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,554
    Rep Power
    174
    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

  2. #12
    Member zlatkoAB's Avatar
    Join Date
    Apr 2008
    Age
    55
    Posts
    287
    Rep Power
    45
    rene
    It is just a content of array ...
    try this one:
    INT arr[5]
    arr[q] <= (1,2,3,4,5)
    print str arr[2]  ' show 2
    
    so ,as you see is very clear what it is,right?

  3. #13
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,554
    Rep Power
    174
    I tried this:

    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
    
    Output:
    3
    0

    ???
    Now I'm speechless
    I think there are missing some Forum-sections as beta-testing and support

  4. #14
    '<=' 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.

  5. #15
    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.

  6. #16
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,554
    Rep Power
    174
    strange: twice nearly the same content

    Uses "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
    
    the above results wrong
    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
    
    this one seems correct.
    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

  7. #17
    Member zlatkoAB's Avatar
    Join Date
    Apr 2008
    Age
    55
    Posts
    287
    Rep Power
    45
    Charles ...
    i know the quirks..

    Rene
    I use Oxygen directly ,not trough thinBasic

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Oxygen can call thinBasic functions
    By Charles Pegge in forum O2h Compiler
    Replies: 9
    Last Post: 18-07-2013, 22:40
  2. some feedback, resume
    By ReneMiner in forum Shout Box Area
    Replies: 18
    Last Post: 02-02-2013, 13:32
  3. more forum feedback possible???
    By Lionheart008 in forum thinBasic General
    Replies: 2
    Last Post: 11-04-2009, 02:42
  4. Using Oxygen subs and functions in thinBasic
    By Charles Pegge in forum O2h Compiler
    Replies: 0
    Last Post: 18-03-2009, 13:25
  5. First impressions/feedback
    By Mark0 in forum thinBasic General
    Replies: 2
    Last Post: 20-09-2004, 10:42

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •