Thanks all for pointing out Return in While loop. Looked at various code
and see where about a year ago I put some Returns in While loops. I guess
they must work sometimes and not others???.

Mike- on vdate=9, I always have the user just enter an eight character
date, i.e., "06/08/01". But if I have it as vdate=8, then the cursor is in
the next to last position "06/08/0|1". May be corrected in a later RBWin
version. And yes, vderr is the error variable.

Dennis
*****

At 05:00 PM 6/8/01 -0700, you wrote:
>Hi Dennis,
>
>The others told you about the return. I noticed you have vdate=9. I think
that 
>should be vdate=10 because there are 10 characters in "06/08/2001". This 
>would depend on how users are entering the date. The other thing is you do 
>not have any definition for .vderr which could be causing some problems. If 
>vderr is the error variable and has been defined then you are okay. Most 
>likely it was the return though as the others stated.
>
>Best regards,
>Mike Young
>
>On Fri, 08 Jun 2001 18:24:07 -0400, Dennis Fleming wrote:
>
>>RBWin 6.x
>>
>>Recent posts from Dr R (I believe), recommended that initializing VARs
>>should be done outside the While loop. I've done that and also always have:
>>Set WhileOpt OFF. But, the following While Loop gets bumped out in an 
>EEP
>>whereas the IF/Endif is fine. (This code checks user enters a valid date.)
>>
>>Example 1.
>>
>>  SET VAR vdate = (CTXT(.#date))
>>  SET VAR vcdate DATE
>>  SET VAR verr = 1
>>  WHILE verr <> 0 THEN
>>    DIALOG "Set Completion Date to:" vdate=9 vlast 1 AT 12
>>    IF vlast = "[ESC]" OR vdate IS NULL THEN
>>      RETURN
>>    ENDIF
>>    SET VAR vcdate = .vdate
>>    SET VAR verr = .vderr
>>  ENDW
>>
>>Example 2.
>>
>>  SET VAR vdate = (CTXT(.#date))
>>  SET VAR vcdate DATE
>>  LABEL AGAIN1
>>  DIALOG "Set Completion Date to:" vdate=9 vlast 1 AT 12
>>  IF vlast = "[ESC]" OR vdate IS NULL THEN
>>    RETURN
>>  ENDIF
>>  SET VAR vcdate = .vdate
>>  SET VAR verr = .vderr
>>  IF verr <> 0 THEN
>>    GOTO Again1
>>  ENDIF
>>
>>>>>>>>>>>
>>
>>
>>Later in the EEP, there is another While Loop which works fine:
>>
>> SELECT COUNT (*) INTO xparts FROM wref WHERE tk_nbr = .tknbr
>> WHILE xparts > "0" THEN
>>   SET VAR prnbr = pr_nbr, prqty = pr_qty IN wref WHERE tk_nbr = 
>.tknbr +
>>   AND COUNT = .xparts
>>   SET VAR prunitp = pr_unitp IN parts WHERE pr_nbr = .prnbr
>>   INSERT INTO tract VALUES +
>>   "IS" .tksdate .prnbr .prqty .prunitp .eqnbr .xtrpo .eqacct .cfid
>>   SET VAR xparts = (.xparts - 1)
>> ENDW 
>>....
>>
>>Any help or ideas are appreciated.
>>
>>Dennis
>>*****
>>Dennis Fleming
>>IISCO
>>http://www.TheBestCMMS.com
>
>
>
>
>
Dennis Fleming
IISCO
http://www.TheBestCMMS.com

Reply via email to