Results 1 to 3 of 3

Thread: GoSub Sub?

  1. #1
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,560
    Rep Power
    175

    GoSub Sub?

    hi there,
    while experimenting i discovered in an o2-example of Aurel using Scintilla...AsciiEdit.o2bas some strange appearing construction that i thought could not work

    He's calling

    Gosub OxyKeywords
    
    so i searched for the matching label "Oxykeywords:" as first token on a line - none
    then i thought about "Subroutines" that as far as i know are sub-sequent portions of the procedure where also the calling "Gosub" should be inside
    alike
    Procedure someProc()
    
    ...
    goSub mySubroutine
    
    ...
    Exit Procedure
    #Ifdef use_Label
    
        mySubroutine:
    
    #Else
    
        Subroutine mySubroutine
    
    #EndIf
    
    ' do whatever
    Retn
    
    #Ifndef use_Label
       End Subroutine
    #EndIf
    
    End someProc
    
    I thought this were the way of using Gosub but Aurels program calls Gousb on global level and that launches a Sub (also on global scope level).

     
    ...not within any procedure here,around line 120..130
    Gosub Qxykeywords
    
    '...
    ' and about 1050 lines below
    Sub Oxykeywords
    ...
    ' no "retn" anyhwere...
    End Sub
    
    that is a bit confusing why could it work?
    Is it because of a rule as the caller is on global scope and can call a procedure (instead of a subroutine) on global level too (since it appears as a far-call to me)
    or
    does oxygen just prioritize trying anything to resolve the target-location before it must raise an error?
    Is that still supported/deprecated/adviseable discouraged?
    I think there are missing some Forum-sections as beta-testing and support

  2. #2
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,560
    Rep Power
    175

    what drives me really nuts

    co2.exe or co2m64.exe + filename run the files without to compile.
    I've seen it before but i dont remember where are the compiler-settings?
    Am searching through dozens of shipped documents but where i would suspect any help is none.

    Not even on the commandline by trying
    co2 /?
    co2 -?
    co2 /h
    co2 -h
    co2 help
    co2 ?
    co2 -help
    co2 /help
    co2 how?
    is any hint to get.
    Repeatedly i wend through inf\, docs\ help.chm, the cfg for oxide and oxygen but where are the commands hidden to control the compiler? Why isn't that present within - oh -which is actually - the current official help-file?
    I think there are missing some Forum-sections as beta-testing and support

  3. #3
    Hi ReneMiner,

    To get the compiler options list just do co2 on its own (without arguments).


    Regarding gosub. It is possible to call a sub that has no arguments using gosub but it is not ideal.

    Normally gosub is used to call a Basic label, but I have also introduced subroutine abc .. exit subroutine .. end subroutine blocks to formalize subroutines. and make them easier to reorganize within a procedure.

Members who have read this thread: 4

Posting Permissions

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