Menu

GCB Programming Manual v1.0 - Subroutines Nitpicking

Help
2015-02-20
2015-02-21
  • playinmyblues

    playinmyblues - 2015-02-20

    On page 53 of the GCB Programming Manual v1.0 found on the GCB homepage, it shows how to provide variables for a subroutine. I got the general jist of what is meant but I had to go back and read it again and then test it in a program to make sure.

    The example shows the following:

    sub MoveArm(ArmX, ArmY, ArmZ)
    'code for the subroutine goes here
    end sub
    In the above sub, ArmX, ArmY and ArmZ are all variables. If the call from above
    is used, the variables will have these values at the start of the subroutine:
    ArmX = NewX
    ArmY = NewY
    ArmZ = 10
    When the subroutine has finished running, GCBASIC will copy the values back
    where possible. NewX will be set to ArmX, and NewY to ArmY. GCBASIC will not
    attempt to set the number 10 to ArmZ.
    

    While it is nitpicking to say that it should read NewX will be assigned to ArmX, it provides for clear reading. The way it is written, it sounds like NewX is on the left side of the relationship.

     
  • Anobium

    Anobium - 2015-02-21

    Thank you. I have updated the Help File.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.