Page 1 of 1

Remembering past occurrence

Posted: Fri Apr 28, 2006 7:33 am
by gateleys
Hi,
I have a situation where I need to keep track of some past occurrence of a field value. Example: If InLink.Column = 'remember me' then I set a stage variable svIsRemember = 1. Now, as I process through other records, I check for occurrence of anohter string InLink.Column = 'String to change', that is EREPLACED with 'new String' if svIsRemember = 1. Note: svIsRemember is reset (=0) if I encounter a column with string 'Stop Remember'.

I could do it if I could write an IF statement without the ELSE clause. Can anyone suggest how I could do this?
Thanks,

gateleys

Re: Remembering past occurrence

Posted: Fri Apr 28, 2006 7:39 am
by Klaus Schaefer
Hi,

I'm not sure if I got your point, but on a stagevar derivation you can specify something like

If in.field1='xxx' then 1 else stagevar

to keep the contents of stagevar "untouched" in the else case.

Best regards
Klaus

Posted: Fri Apr 28, 2006 8:26 am
by kcbland
Yeah, what Klaus said. :lol:

Posted: Fri Apr 28, 2006 8:38 am
by gateleys
AAAHH!! :oops: Its been a loooonnngg week. Thanks.

gateleys

Posted: Fri Apr 28, 2006 3:57 pm
by ray.wurlod
In an expression you can not use statements. The conditional expression (IF test THEN value ELSE value) is an expression; it must always return a value and must, therefore, always have both a THEN part and an ELSE part.

The IF statement is only available in Routines.