Call a function with an argument inside registry field

Started by velasquez, January 12, 2015, 02:08:39 PM

Previous topic - Next topic

velasquez

Quote from: owenwengerd on January 09, 2015, 11:04:30 AM
Quote from: velasquez on January 09, 2015, 09:21:00 AM
I need to call a function with an argument inside field registry.

Your syntax is incorrect. It should be:
ValueData: {code:myfunction|myargument};

However, your function only appends the argument, so there is no need for it:
ValueData: {code:myfunction}myargument;

Better:
ValueData: {app}\MAyapp r4.0\myargument;

Please post future questions in the forum so that everyone can benefit from the discussion.

Hello Owen,
His answer was helpful with the function call.
What I need to pass to the function a variable I created in another point of my script.
ex:

Ex: myvariable1: = test_a.vlx
      myvariable2:  = test_b.vlx
      myvariable3:  = test_c.vlx

ValueData: {code:myfunction|myvariable..};

I'm not getting it.
Thanks

owenwengerd

If the value is in a global variable, your function can refer directly to the global variable and ignore the argument.

velasquez

Quote from: owenwengerd on January 12, 2015, 03:09:25 PM
If the value is in a global variable, your function can refer directly to the global variable and ignore the argument.

This I do not understand Owen.
You mean I need a function for each variable?

owenwengerd

ValueData: {code:myFunction};

Code (autolisp) Select
var myVariable1: String;

//set myVariable1 as required

procedure myFunction();
begin
  //do something with myVariable1
end;

velasquez

Quote from: owenwengerd on January 13, 2015, 08:29:39 AM
ValueData: {code:myFunction};

Code (autolisp) Select
var myVariable1: String;

//set myVariable1 as required

procedure myFunction();
begin
  //do something with myVariable1
end;


Ok Owen,
thank you