Yoko
http://forum.yoko.com.ua/

goto string var
http://forum.yoko.com.ua/viewtopic.php?f=3&t=8393
Page 1 of 1

Author:  primate [ 2006-08-02 06:43:41 ]
Post subject:  goto string var

is it posssible make something like this work using str()?Cause im trying to do a kind of switch , but goMenu() is returning me a parse error.Thanks.

Code:

var b=1

  sub goMenu()

     goto 'A'+str(b)

  end sub

  sub menu()

 
   
       A1:
       uo.print(str(b))
       wait(2000)
       b=b+1
       goMenu()
     

       A2:
       uo.print(str(b))
       wait(2000)
       b=1
       goMenu()
     
end sub

Author:  Ex-Brodyaga [ 2006-08-02 14:33:35 ]
Post subject: 

Maybe some like this?
Code:
var b

sub main()
b=1
GoMenu(b)
end sub

sub GoMenu(b)
if b==1 then
     uo.print(str(b))
     b=b+1
end if
if b==2 then
     uo.print(str(b))
     b=1
end if
end sun

Page 1 of 1 All times are UTC+02:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/