Let vVarname1=1+1;
Set vVarname2=2+2;
$(vVarname1) will return 2.
$(vVarname2) will return 4.
Assuming variable is created in script and assigned value from expression.
If expression happens to be null what will happen to variable? Variable can be accessed as isNull(Var_name) in script and but it will not be available in GUI.
That is one situation where we might want to understand the difference between Let and Set.
Let vVarname3=peek(…); // Peek() returns null
Set vVarname4=peek(…); // Peek() returns null
If peek returns ‘null’ vVarname3 will not available in GUI but vVarname4 will be. vVarname4 can be accessed with $(), $(#), $(#-).
if($(vVarname3)=’One’) then //Left side of evaluating expression cannot be empty
……
End if
Result:
——
Error: Variable missing
if(‘$(vVarname3)’=’One’) then //Instead I put ”
……
End if
Result:
——
” = ‘one’ not equals so else part will be executed.
If it is numeric we can also try as below.
$(#=vVarname3) which will return 0
0=’one’ wrong comparison, have to be cautious about that.