Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange behavior - Bug or Feature
Message
From
06/06/2002 12:00:15
Steven Herbin
SNH Computing Corporation
Swan Lake, New York, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Strange behavior - Bug or Feature
Miscellaneous
Thread ID:
00665527
Message ID:
00665527
Views:
63
I was trying to fill values into a new table from an old table. Inside the SCAN of the old table, I placed the following code:

INSERT INTO xxxx (rc, passnbr,glacct,Ppdate,job,OBJECT,M2M,M3M,M4M,L2L,L3L,L5L,L6L,L7L) ;
VALUES ;
(mrc.rc, ;
mrc.passnbr, ;
mrc.glacct, ;
mrc.Ppdate, ;
mrc.job, ;
gla.OBJECT, ;
0.00, 0.00, 0.00,
IIF(!EMPTY(job) AND gla.OBJECT="500",mrc.Amount,0.00), ;
IIF(!EMPTY(job) AND INLIST(gla.OBJECT,"505","510","515","520"),mrc.Amount,0000000.00), ;
IIF(EMPTY(job) AND gla.OBJECT="500",mrc.Amount,0000000.00), ;
IIF(EMPTY(job) AND INLIST(gla.OBJECT,"505","510","515","520"),mrc.Amount,0000000.00), ;
IIF(EMPTY(job) AND !INLIST(gla.OBJECT,"500","505","510","515","520"),mrc.Amount,0000000.00))

When I checked the values of L2L through L7L, they all contained zero. I knew that several of the fields should have had values.

So I recoded:

INSERT INTO xxxx (rc, passnbr,glacct,Ppdate,job,OBJECT,M2M,M3M,M4M) ;
VALUES ;
(mrc.rc, ;
mrc.passnbr, ;
mrc.glacct, ;
mrc.Ppdate, ;
mrc.job, ;
gla.OBJECT, ;
0.00, 0.00, 0.00)
REPLACE xxxx.L2L WITH xxxx.L2L + IIF(!EMPTY(job) AND gla.OBJECT="500",Amount,0000000.00) ;
xxxx.L3L WITH xxxx.L3L + IIF(!EMPTY(job) AND INLIST(gla.OBJECT,"505","510","515","520"),Amount,0000000.00) ;
xxxx.L5L WITH xxxx.L5L + IIF(EMPTY(job) AND gla.OBJECT="500",Amount,0000000.00) ;
xxxx.L6L WITH xxxx.L6L + IIF(EMPTY(job) AND INLIST(gla.OBJECT,"505","510","515","520"),Amount,0000000.00) ;
xxxx.L7L WITH xxxx.L7L + IIF(EMPTY(job) AND !INLIST(gla.OBJECT,"500","505","510","515","520"),Amount,0000000.00)

This placed all the values in the proper places.

I don't know if this is a bug or just the way it works.
Steven Herbin
SNH Computing Corporation
Swan Lake, NY
Next
Reply
Map
View

Click here to load this message in the networking platform