View Single Post
Old 26 June 2020, 18:46   #3
Registered User

Join Date: Sep 2019
Location: Leicester / England
Posts: 77
It's 20+ years since I last did any AMOS, but you could "sort of" do it by passing an argument to the second procedure and, if that argument is a set value go to that label as below.

Any usage of "PRC2" will need an argument so, if you don't want to jump to the label, use something like PRC2[0].

It's not particularly nice programming though. If you need the same code in more than one procedure then put it in it's own procedure and just call that procedure from where it is required, or just merge both procedures and use If Then statements.

' Run procedure PRC2 without jumping to the label

' Run procedure PRC1 which in turn runs PRC2 jumping to the label

' The first procedure
Procedure PRC1

Print "In Proc1"

' Call the second procedure with a '1' to jump to the label section.

End Proc

' The second procedure - call this with a '1' to jump to the label, or anything else to not.
Procedure PRC2[ARG]
If ARG=1 Then Goto LABEL1

Print "Not jumping"

Print "Jumped to the label"

End Proc
Exodous is offline  
Page generated in 0.04244 seconds with 11 queries