|
Description
Need to use the strcmp function in order to compare values.
Solution
From discussion forum:
Dec 01 2000 : Tim Kriksciun
RTE conditional 'if' statement
I am attempting to perform the following simple conditional statement in the action() section of an RTE script in VUGen.
char msg[] = "Ds";
char dupe[] = "Ds";
lr_message("msg: %s", msg);
lr_message("dupe: %s", dupe);
if (msg == dupe){
lr_message("Dupe");
}
else{
lr_message("Nope");
}
It does not appear that the 'if' conditional statement is being evaluated as the execution log reports the following results:
msg: Ds
dupe: Ds
Nope
Solution:
Dec 01 2000 : Jason Craven
RTE conditional 'if' statement
You have to compare the strings in a different way:
...
if (strcmp(msg, dupe) == 0){
lr_message("Dupe");
}...
Hope this helps. |
|