Please people, I do need help for this
Hello people!
I'm trying to write a script in LR that should, technically, pick up the data from a file (.csv comma separated), put the first column first row in a variable (it's a 4 characters text), then, based on an IF statement, should run the specific action (where it has to take all the other data from the row and put it in specific variables), then come back to the "start" script, take the second row of the first column, put the data in the variable and keep going until the datafile ends.
1st problem: the data file
I tried different formats, .csv comma separated looks like to be the only one accepted but, when gets the data, it takes the entire row with all the data in there, not only the first part.
I'm trying to figure it out using a separated file for each column, at least to make it work.
2nd problem: the text variable
I can't find a way to pass the parameter to a variable, "string" doesn't work, "char" is getting just the first character (in every possible way called), lr_save_string doesn't work at all.
3rd problem: the IF statement
Because of the two previous problems, I'm not able to write a proper IF statement that works...
Here is an example of what I'm trying to write (with the different ways I tried):
Start()
{
char temp[]="TO01";
lr_save_string("TO01","trans");
TE_wait_sync();
if ("{trans} == TS01") {
Trans01();
} else if ("{trans} == TO01") {
Trans02();
} else if ("{trans} == SD01"){
Trans03();
} else if ("{trans} == CP01"){
Trans04();
}return 0;
}Start()
{
TE_wait_sync();
if (strcmp(lr_eval_string("{test}","TS01"))==0) {
Trans01();
} else if (strcmp(lr_eval_string("{test}","TO01"))==0) {
Trans02();
} else if (strcmp(lr_eval_string("{test}","SD01"))==0){
Trans03();
} else if (strcmp(lr_eval_string("{test}","CP01"))==0){
Trans04();
}return 0;
}Start()
{
TE_wait_sync();
if (lr_eval_string("{test}" == "TS01") {
Trans01();
} else if (lr_eval_string("{test}" == "TO01") {
Trans02();
} else if (lr_eval_string("{test}" == "SD01"){
Trans03();
} else if (lr_eval_string("{test}" == "CP01"){
Trans04();
}return 0;
}None of these ways works.
NB: "test" is the parameter that contains the table with the data.
Any help will be really appreciated!
Thank you all!