If immediately after the command that is expected to return the error, you trap it 
into another variable, you can display the error.

SET ERROR VAR vErrVar
SET VAR vErrSave INTEGER
-- execute something here -- the IMMEDIATE NEXT LINE must be as follows
-- anything else will reset the error variable to zero
SET VAR vErrSave = .vErrVar
SHOW ERROR vErrSave



James Hageman <[EMAIL PROTECTED]> wrote:

>I don't know of anyway to (cval('error')) just tells you if its on or off.
>
>Claudine Robbins wrote:
>
>>Is there any way you can trap the error message and use it somehow, like
>>a particular SQL value?
>>
>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of James
>>Hageman
>>Sent: Wednesday, September 10, 2003 2:48 PM
>>To: RBASE-L Mailing List
>>Subject: [RBASE-L] - RE: Create variable on the fly
>>
>>No, because I want it for the case where it doesn't exist yet or was 
>>cleared but the rest of the command file requires the variable.
>>Jim
>>
>>Ramsour Mike wrote:
>>
>> �
>>
>>>Would this work they way you envision? �I think you will still need to
>>>predefine the variable.
>>>
>>>SET VAR V1 = NULL
>>>--
>>>SET VAR VENDKEY TEXT
>>>--
>>>IF V1 IS NULL THEN
>>>--
>>> DIALOG 'Enter value for v1' v1 vEndKey 1
>>>--
>>>ENDIF
>>>--
>>>RETURN
>>>
>>>Hope this helps.
>>>
>>>Mike Ramsour
>>>
>>>-----Original Message-----
>>>From: James Hageman [mailto:[EMAIL PROTECTED]
>>>Sent: Wednesday, September 10, 2003 3:36 PM
>>>To: [EMAIL PROTECTED]
>>>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.
>>> 
>>>
>>> � �
>>>
>
>


-- 
Albert Berry
Full Time Consultant to
PSD Solutions
350 West Hubbard, Suite 210
Chicago, IL 60610
312-828-9253 Ext. 32


__________________________________________________________________
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455

Reply via email to