Home   Help Search Login Register  

Author Topic: script labels as parameter?  (Read 448 times)

0 Members and 1 Guest are viewing this topic.

Offline Blanco

  • Former Staff
  • ****
script labels as parameter?
« on: 16 Jun 2004, 19:53:56 »
I've seen this in "script1.sqs" :
Code: [Select]
#label1
... code... more code...


#label2

... code... more code...

Then in another script in the same mission I saw this :

["label2"] exec "script1.sqs"

I found this executes the code started from #label1 in script1.sqs. Interesting... I wanna know more...  :)
Can I add more parameters?
like this :
["label1", mygrp] exec "script1.sqs"
Is "label1" or mygrp the first parameter in the exec array?


 
« Last Edit: 16 Jun 2004, 20:26:57 by Blanco »
Search or search or search before you ask.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:script labels as parameter?
« Reply #1 on: 16 Jun 2004, 20:05:47 »
Indeed. This cuts down the number of files/global variables in your mission.
All you need to is to exec the script like you have it there and put
_bookmark = _this select 0
goto _bookmark
in the begining of the script.
Not all is lost.