Home   Help Search Login Register  

Author Topic: Number of arguments passed to a script  (Read 468 times)

0 Members and 1 Guest are viewing this topic.

trident

  • Guest
Number of arguments passed to a script
« on: 12 Oct 2004, 16:28:45 »
Hi,

Is there a limit on the number of arguments you can pass to a script?
Browsed the Comref and FAQ, but did not find a reference anywhere.

Regards
/Trident

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Number of arguments passed to a script
« Reply #1 on: 12 Oct 2004, 17:05:09 »
Dunno.   But knowing OFP, I suspect the answer is yes, but it's a sufficiently high number that it's unlikely you'll ever need to worry your pretty little head about it.
Plenty of reviewed ArmA missions for you to play

trident

  • Guest
Re:Number of arguments passed to a script
« Reply #2 on: 12 Oct 2004, 17:09:40 »
OK,

I'll do some trail's and if I find a limit I will post it.

/Trident

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Number of arguments passed to a script
« Reply #3 on: 13 Oct 2004, 11:55:50 »
Passing more than one object onto a script will result in
passing an ARRAY to the script.

Suma (one of BIS lead programmers) one day said that:

arrays are only limited to cpu memory, it sounds to be
open range, depending on available resources.

As my pc is f**ed up at the mo, i can't do anything to test this
out myself, but i can suggest you to try it out yourself.

Just create an array from a loop and pass the result onto
a script. Count the content of the passed array in the script
and see if it's correct.

scriptA

_max_count = 255
_count = 0
_array = []

#loop

_array = _array + _count
_count = _count + 1
?(_count < _max_count): goto "loop"

_array exec "scriptB.sqs"

exit

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

scriptB

_array = _this
_number = 0


_number = count _array
hint format ["%1",_number]

exit

Now all you need to do to check out the number of allowed
segments to be passed to a script is:

change the numeric variable _max_count to the number
you want to test

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

trident

  • Guest
Re:Number of arguments passed to a script
« Reply #4 on: 13 Oct 2004, 16:48:16 »
Thanks Chris,

Will test when MY pc is up and running.

/Trident