label bgproc
Set var vCheck = .v1
if vCheck = '.v1' then
  pause 2 using 'Variable doesn''t Exist!'
  dialog 'Do you want to Create it?' vres1 vk1 yes
    if vres1 = 'yes' then
     *( One way for var creation
      out runfile
        wri 'Set Var v1 text'
        wri 'ret'
      out scr
      run runfile
       )
     -- The normal way
     set var v1 text
    endif
    goto bgproc
else
  pause 2 using 'Variable Exists!'
endif
label ndproc
RETURN

----- Original Message ----- 
From: "James Hageman" <[EMAIL PROTECTED]>
To: "RBASE-L Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, September 10, 2003 2:35 PM
Subject: [RBASE-L] - Create variable on the fly


> I want to be able to find out if a variable exists and if not to create 
> it and then pronpt the user to assign a value to it.
> 
> I thought I could do something like :
> 
> IF (IFEXIST(v1,.v1,NULL)) IS NULL THEN
>       DIALOG 'Enter value for v1' v1 vEndKey 1
> ENDIF
> 
> But I get an error message telling me v1 doesnt exist, Right! I know.
> 
> 

Reply via email to