Jan -

Try this:

SET VAR vd1 INTEGER   (or whatever datatype the original variable is)
SET VAR vd1txt TEXT

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

That will define the variable if it's not already in existence without
changing its value if it is.

Sami

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sami Aaron
Software Management Specialists
913-915-1971
[EMAIL PROTECTED]
 

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Jan Johansen
Sent: Tuesday, April 26, 2005 10: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