Home   Help Search Login Register  

Author Topic: parsing name of variable  (Read 1037 times)

0 Members and 1 Guest are viewing this topic.

Offline Grizzlie

  • Members
  • *
parsing name of variable
« 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?
« Last Edit: 26 May 2005, 19:53:31 by Grizzlie »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:parsing name of variable
« Reply #1 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]

« Last Edit: 26 May 2005, 19:47:20 by THobson »

Offline Grizzlie

  • Members
  • *
Re:parsing name of variable
« Reply #2 on: 26 May 2005, 19:52:45 »
It was only fictional example :)
But thanks for missing bracket - fixing

Offline Grizzlie

  • Members
  • *
Re:parsing name of variable
« Reply #3 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.