The reason why one cannot specify a "variable" realtime GOTO target is because the uv compiler actually replaces those with direct jump instructions into the pseudo-code stream. In the first pass, it notes the offsets of LABELs, then on the second pass updates the GOTO references to those labels. If a GOTO references a non-existing LABEL, your compilation dies. Since the object code doesn't retain LABELs, this type of functionality isn't available.
The closest you may get might be to use: ON SUBINDEX GOSUB SUB1,SUB2,...SUBxx, which uses SUBINDEX to determine which SUBx is executed. This allows the compiler to validate labels but gives you some flexibility at runtime to determine which to actually use. =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= "I reject your reality and substitute my own" - Adam Savage Glenn M. Herbert - Connectivity Development Engineer Information Integration Solutions, IBM Software Group 50 Washington Street Westboro, MA 01581 508-599-7281 direct [EMAIL PROTECTED] wrote on 02/08/2006 02:31:39 PM: > I guess you could use: > > SUBNAME="XXXX" > GOSUB SUBLIST > . > . > . > SUBLIST: > BEGIN CASE > CASE SUBNAME="SUB1" > . > . > CASE SUBNAME="SUB2" > . > . > END CASE > RETURN > . > . > > George > > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] Behalf Of Barry Brevik > > Sent: Wednesday, February 08, 2006 2:04 PM > > To: U2-users (E-mail) > > Subject: [U2] [UV] GOSUB variable-name? > > > > > > I would like to pass a variable (let's call it "SUBNAME") to > > a subroutine, > > and this variable would contain the name of an existing label > > which I will > > call "TEST". > > > > The subroutine can then do GOSUB TEST, but GOSUB SUBNAME will > > not compile. > > > > Aside from CALL @VARIABLENAME, is there any way to branch > > indirectly in > > universe? This would be really useful for me. > > > > Barry Brevik > > ------- > > u2-users mailing list > > u2-users@listserver.u2ug.org > > To unsubscribe please visit http://listserver.u2ug.org/ > ------- > u2-users mailing list > u2-users@listserver.u2ug.org > To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/