Alastair,
I tried your suggestion but I still get the SET Error and the control
goes back to the keyboard.
I checked the var, and the var for my DATE_A was still 01/01/2009 after
the code runs. See below.
Variable = Value Type
------------------ ------------------------------ --------
Date_A = 01/01/2009 DATE
Date_B = 01/01/2009 DATE
vAbort = 0 INTEGER
vYesNo = Yes TEXT
vEndKey = [Enter] TEXT
This is the code. It looks like it hangs on the SET VAR vAbort since it
has not changed.
I set this as 0 before this code runs.
SET VAR Date_A = (GETDATE('Pick Processing Start Date'))
IF Date_A = 01/01/2009 THEN
SET VAR vAbort = 1
PAUSE 2 USING 'OPPERATION ABORTED! NO DATE PICKED.'
BREAK
ENDIF
Could it be I am going about this all wrong. Two buttons appear on the
GETDATE box.
I have been hitting the Cancel button. Am I supposed to set that button
to a certain value?
Jim
________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of Alastair
Burr
Sent: Saturday, August 15, 2009 9:58 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: GETDATE
Jim,
My _guess_ is that when you trace in the editor you have a value in the
GETDATE function which gets set simply because a value is there.
When you run from your button and [Esc] then your command:
SET VAR Date_A = (GETDATE('Pick Processing Start Date'))
might fail because there is no value to set and you can't set a date
variable to an invalid date.
Try setting you variable Date_A to a valid date that must be out of your
expected range. I use 01/01/1900 as my default. Test for whatever
default value you choose rather than null or, if you have a defined
range, say 01/01/1950 to today, test for between 01/01/1950 and .#DATE -
you don't really care if it's null just if it's not in your acceptable
range.
Regards,
Alastair.
----- Original Message -----
From: Jim Belisle <mailto:[email protected]>
To: RBASE-L Mailing List <mailto:[email protected]>
Sent: Saturday, August 15, 2009 3:01 PM
Subject: [RBASE-L] - GETDATE
Thanks for all the response I received in regards to my question
on GETDATE. I have the below code in a bit button.
This code works fine when I trace it in the RBEDITOR but comes
up with a SET error when run on the form.
The error occurs when I hit the cancel or escape button on the
GETDATE function.
As you can see, the GETDATE function is nested in the WHILE
loop.
SET VAR Date_A DATE = NULL
SET VAR Date_B DATE = NULL
SET VAR vAbort INT = 0
SET VAR vMsg TEXT
SET VAR vMsg2 TEXT
WHILE CONT_PROMPT = 'Y' THEN
My code
This works fine!
IF vYesNo = 'No' THEN
SET VAR vAbort = 1
PAUSE 2 USING 'OPPERATION ABORTED!'
BREAK
ENDIF
This part gives the error when I hit cancel or escape (while in
the form). Works fine in the RBEDIT mode.
SET VAR Date_A = (GETDATE('Pick Processing Start Date'))
IF Date_A IS NULL THEN
SET VAR vAbort = 1
PAUSE 2 USING 'OPPERATION ABORTED! NO DATE PICKED.'
BREAK
ENDIF
ENDWHILE
CLS
IF vAbort = 1 THEN
CLEAR VAR Date_A,Date_B,LAST_DATE,CONT_PROMPT,CONT_PROMPT2, +
vmsg,vMsg2,VLAST_DATE,vYesNo,vEndKey,USER_CHECK,vabort
RETURN
CLS
ENDIF
CLEAR VAR
LAST_DATE,CONT_PROMPT,CONT_PROMPT2,vmsg,vMsg2,VLAST_DATE,vYesNo,vEndKey
Any help appreciated.
Jim
________________________________
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.392 / Virus Database: 270.13.57/2303 - Release
Date: 08/14/09 18:10:00