I think that is about the only way in version 5.
In version 6 you will be able to use a function block to reduce that to a single test:
function$Exists(foo)<<EOFlocalB=1eval("B = ".foo)returnexists("B")EOFarrayA[3]A[2]="two"dofor[xin"A[1]A[2]A[3]"]{if($Exists(x)){printx," exists"}else{printx," does not exist"}}
[~/temp] gnuplot E.gp
A[1] does not exist
A[2] exists
A[3] does not exist
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think that is about the only way in version 5.
In version 6 you will be able to use a function block to reduce that to a single test:
[~/temp] gnuplot E.gp
A[1] does not exist
A[2] exists
A[3] does not exist