Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to use the Exists() function in an IF Statement:
IF Exists([LogFilePath], '123') THEN
EXIT SUB; // Already processed, skip it
ENDIF
The IF line throws a general error in all versions of QV I've tested (10, 11, 12). The [LogFilePath] field does exist.
The Help for QV12 Exists states:
'can be used in the where clause of a LOAD statement or an IF statement."
The QV11 Help says nothing about where it can be used. So is this a bug (or my coding error) that it won't work in an IF? Or is the Doc wrong?
-Rob
Hi Rob,
first time I tried to use Exists() outside of LOAD and it seems to work with quoted field:
Test:
LOAD * INLINE [
F1
A
B
C
];
IF Exists('F1', 'B') THEN
TRACE B exists!;
END IF
IF Exists('F1', 'X') THEN
TRACE X exists!;
END IF
Tested with QV 11.20 SR14
- Ralf
Hi Rob,
first time I tried to use Exists() outside of LOAD and it seems to work with quoted field:
Test:
LOAD * INLINE [
F1
A
B
C
];
IF Exists('F1', 'B') THEN
TRACE B exists!;
END IF
IF Exists('F1', 'X') THEN
TRACE X exists!;
END IF
Tested with QV 11.20 SR14
- Ralf
Thanks Ralf! The quotes was what I needed.
-Rob