Thanks group,

This is exactly what I thought of while taking a short break (DMV to get
renewed).
I need another cup of coffee.

Jan

----- Original Message -----
From: "Dawn Oakes" <[EMAIL PROTECTED]>
To: "RBG7-L Mailing List" <[email protected]>
Sent: Tuesday, April 26, 2005 9:08 AM
Subject: [RBG7-L] - RE: Variable question


Jan
Why not set it to null initially?

Set var vd1txt TEXT = null
Set var vd1txt = (ctxt(.vd1))

If vd1 exists and has a value, vd1txt will change from null to whatever.
If it doesn't exist, the second set var line will cause an error, but
with error messages off, you won't see it and vd1txt will still be null.

Dawn

-----Original Message-----
From: Jan Johansen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 26, 2005 11:56 AM
To: RBG7-L Mailing List
Subject: [RBG7-L] - Variable question

What syntax can I use to create a variable if I check for the existance
of a variable?

I'm trying to pass parameters that may not exist. So if they dont exist
create them.

I've tried

IF vd1 EXISTS THEN
    SET VAR vd1txt = (CTXT(.vd1))
  ELSE
    SET VAR vd1txt = NULL
ENDIF

but since vd1 doesn't exist it errors out. Turning off error messages
doesn't help.

So is there a way to create a variable based on the fact that another
variable exists or not?

Jan

Reply via email to