Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug: literal and variables null sum
Message
From
01/11/2004 10:16:17
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
Bug: literal and variables null sum
Miscellaneous
Thread ID:
00956549
Message ID:
00956549
Views:
64
Previous issue Thread #956542

Bug/Issue : 7 of 27

TITLE: Bug: literal and variables null sum uses a different calculate process

VERSION: 09.00.0000.1720 and previous

OBSERVED BEHAVIOR:
Compute a bad datatype sum can not fire a error if a literal NULL it is present into the sum at left of the bad addend.
With dynamic code, this can to skip/fire errors not tested at developer time.

EXPECTED BEHAVIOR:
Compute a bad datatype sum have to fire a error, or it have to stop the computation when a deterministic NULL it is caught up.

REPRO CODE:
CLEAR
ON ERROR ?? '    >>>', MESSAGE()

* Correct NULL
? '1 ',.NULL.+CALLME1()+CALLME2()+CALLME3()

* NULL STOP THE SUM, BUT VFP COMPUTE THE OTHERS ADDENDUM AND DISCARD THEY
? '2 ',CALLME1()+.NULL.+CALLME2()+CALLME3()

* FAIL when FIRST ERROR SUM STOP THE PROCESS
? '3 ',CALLME1()+CALLME2()+.NULL.+CALLME3()

* Then, WITH A MACRO HAVE YOU THE SAME RESULTS ? Of course, YES

x='.NULL.'
? '7 ',&x+CALLME1()+CALLME2()+CALLME3()
? '8 ',CALLME1()+&x+CALLME2()+CALLME3()
? '9 ',CALLME1()+CALLME2()+&x+CALLME3()
* IF YOU USE A VARIABLE, THE PROCESS IS IT THE SAME ? NO

* but with a variable, no, you give 3 fails
x=.NULL.
* FAIL FIRST ERROR SUM STOP THE PROCESS
? '4 ',m.x+CALLME1()+CALLME2()+CALLME3()
? '5 ',CALLME1()+m.x+CALLME2()+CALLME3()
? '6 ',CALLME1()+CALLME2()+m.x+CALLME3()

PROCEDURE CALLME1
?? PROGRAM()
RETURN 'A'

PROCEDURE CALLME2
?? PROGRAM()
RETURN 1

PROCEDURE CALLME3
?? PROGRAM()
RETURN DATE()
Thanks
Fabio
Reply
Map
View

Click here to load this message in the networking platform