OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Grizzlie on 26 May 2005, 19:24:33

Title: parsing name of variable
Post by: Grizzlie on 26 May 2005, 19:24:33
I was trying to find answer here but maybe my langue skills r too weak.
What i'm asking for.
Using name of variable in script call parses this variable value.
And i want to parse variable name for later use.
For instance
[a, [a1, var1],[a2,var2] ] exec "move.sqs"
where a is vehicle, a1 & a2 - points to move and var1 & var2 - variables determining if in point vehicle is to wait or no
Is it possible?
Title: Re:parsing name of variable
Post by: THobson on 26 May 2005, 19:45:03
I think you mean passing a varaible, not parsing a variable.

[a, [a1, var1],[a2,var2] exec "move.sqs"

needs an extra ] as follows

[a, [a1, var1],[a2,var2] ] exec "move.sqs"

This is quite valid, but I would use a different name 'move' is an OFP command.   It will still work it is just confusing.

in the script you would have

_veh = _this select 0
_point1 = _this select 1
_point2 = _this select 2
.
.
.


_veh will be a
_point1 will be the array [a1, var1]
and
_point2 will be the array [a2, var2]

Title: Re:parsing name of variable
Post by: Grizzlie on 26 May 2005, 19:52:45
It was only fictional example :)
But thanks for missing bracket - fixing
Title: Re:parsing name of variable
Post by: Grizzlie on 28 May 2005, 18:58:45
Thanks THobson for "hint" :)
Using "pass" for search helped. I still do not know how to pass name of variable, but i have found solution of my problem.