Rapid

Syntax error using a matrix

4 posts in this topic

#1 ·  Posted (edited)

hello guys, I have this - 

Global $UserVals[4][4] = [[4.50,4.50,4.50,4.50],[12,10,8,6],[0,0,0,0],[60,50,40,0]]

global $matrix = 2
 HotKeySet("^z",Timer($UserVals[1,$matrix]))

and a timer function that recieves a value

 

now when I run it... it gives me this

 

error: syntax error
HotKeySet("^z",Timer($[1,

I cant call a specife value from a matrix?

Edited by Rapid

Share this post


Link to post
Share on other sites



Oh wow im so dumb jeez. 

Instead of uservals[x][y] I used uservals[x,y]

dear brain - please come back

Share this post


Link to post
Share on other sites

The 2nd parameter in HotKeySet is the function name that you want to call. You cannot specify any parameter.

The syntax you used proceeds this way :

$ret = Timer($UserVals[1][$matrix])
HotKeySet("^z", $ret)

Is it what you want to do ?

 

It seems the correct syntax would be something like this, no ?

Global $UserVals[4][4] = [[4.50,4.50,4.50,4.50],[12,10,8,6],[0,0,0,0],[60,50,40,0]]
Global $matrix = 2

HotKeySet("^z","_CallTimer")

Func _CallTimer()
    Timer($UserVals[1][$matrix])
EndFunc



 

 

Share this post


Link to post
Share on other sites

Yeh I got it to work fine, but i recreated the whole proccess.

thanks mate :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now