Using Column Name in Function<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Can somebody help me out with the following??
Column1 = char(ColumnName(1));
Column2 = char(ColumnName(2));
Eval(Parse(EvalInsert("\[
obj << simulator(
1,
Factors(
AB << Random( ^distNameOne^( ^strParameterOne^ ) ),
^Column2^ << Random( ^distNameTwo^( ^strParameterTwo^ ) )
),
Responses(
:Column 3 << No Noise
),
Automatic Historam Update(1),
Simulate
);
]\")));
If I name the first column "AB" manually, the profiler works fine for it. However attempting to automatically use the column name as in Column2 does not work. Any ideas on how to get it to work?
Thanks
Using Column Name in FunctionGreat, everything works like a charm. Thanks again!
Re: Using Column Name in FunctionYou probably need quotes around the column name then.
:name("^Column2^") << Random( ^distNameTwo^( ^strParameterTwo^ ) )
Using Column Name in FunctionI get the following error when I tried that:
Name arg must be quoted string Line 5 Column 9: name(.....
Using Column Name in FunctionThat column name won't work because of the forward slash. This construct should work though:
:name(^Column2^) << Random( ^distNameTwo^( ^strParameterTwo^ ) )
Re: Using Column Name in FunctionThanks for the quick response.
At first your solution did not seem to work. Then, I decided to manually change the name of the columns to something simpler and that did the trick.
Any ideas why a column named something like "S/B nominal length-c" won't work, but if I renamed it to "SB nominal length c" it does work??
BTW, I used the following format:
:^Column1^ << Random
Or perhaps there's a way to have the script automatically remove any punctuation at the beginning?
Thanks
Using Column Name in FunctionYou're sending column actions to a string. Try these two variations:
:^Column2^ << Random( ^distNameTwo^( ^strParameterTwo^ ) )
column(^Column2^) << Random( ^distNameTwo^( ^strParameterTwo^ ) )
or maybe even
as column(^Column2^) << Random( ^distNameTwo^( ^strParameterTwo^ ) )