Good morning,
I'm checking dates, day per day, against a cursor of festive days.
I would like to write a dynamic IF, like this:
If _calendar.DayType<ind> == 3 Then
(expected output for the engine, with ind=1: "If _calendar.DayType1 == 3 Then")
Where ind is the dynamic day of the week that I have to check in my loop.
I don't want to EVAL (or &) the whole IF block if possible, but only the row (IF ...) where I have the dynamic value.
I tried (with DATE()+1 for tests)
IF &('_calHonda.DayType' + ALLTRIM(TRANSFORM(DOW(DATE()+1)))) == 3 THEN
and similars, nothing
I tried to just print the content of the cursor, dynamically:
? &('_calHonda.DayType' + ALLTRIM(TRANSFORM(DOW(DATE()+1))))
But this gives an error too.
If I write the whole IF block inside a string, from begin to EndIf, and evaluate the string, it's probably going to work, like it's supposed to do, but I don't really like this idea very much.
Is there a way to EVAL only the row I need?
Thank you very much.
I'm checking dates, day per day, against a cursor of festive days.
I would like to write a dynamic IF, like this:
If _calendar.DayType<ind> == 3 Then
(expected output for the engine, with ind=1: "If _calendar.DayType1 == 3 Then")
Where ind is the dynamic day of the week that I have to check in my loop.
I don't want to EVAL (or &) the whole IF block if possible, but only the row (IF ...) where I have the dynamic value.
I tried (with DATE()+1 for tests)
IF &('_calHonda.DayType' + ALLTRIM(TRANSFORM(DOW(DATE()+1)))) == 3 THEN
and similars, nothing
I tried to just print the content of the cursor, dynamically:
? &('_calHonda.DayType' + ALLTRIM(TRANSFORM(DOW(DATE()+1))))
But this gives an error too.
If I write the whole IF block inside a string, from begin to EndIf, and evaluate the string, it's probably going to work, like it's supposed to do, but I don't really like this idea very much.
Is there a way to EVAL only the row I need?
Thank you very much.