Open maynardGK opened 4 years ago
Another odd behavior of concatenation: "&&" should be interpreted(?) as just "&" but is not:
GDL> resu2a=FILE_WHICH('../src/', filetest) & print,resu2a
../src/gdl
GDL> resu2a=FILE_WHICH('../src/', filetest) & & print,resu2a
../src/gdl
GDL> resu2a=FILE_WHICH('../src/', filetest) && print,resu2a
% Variable is undefined: PRINT
% Execution halted at: $MAIN$
concerning the second point
IDL> resu2a=FILE_WHICH('../src/', filetest) && print,resu2a
% Keyword RESU2A not allowed in call to: PRINT
% Execution halted at: $MAIN$
Overall I've had little-to-no problems with command concatenation ("&") and line continuation ("$"). However as I recently have transferred scripts to a new computer I discovered this error when an extra "&" slipped into an endif-else-begin statement:
This is a valid statement in GDL, but it shouldn't be, just as "else begin" by itself is not. To see this in a linux system one would reverse the logic: