Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IF command - order of items - results
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01513802
Message ID:
01513805
Views:
51
Unlike some other languages, VFP always perform logical operations in the order they are listed. However, if seek will not find anything, you may be on EOF() or wrong record.

>Hi Gang!
>
>I was asked to see why the Application sometimes acts like it gets things out of order when processing....
>
>e.g... The Application wants to REVERSE claims sent in to 2 third party insurance claims departments.
>
>Sometimes it acts like it reverses the Primary, but not the Secondary. Sometimes the Secondary and not the Primary.
>
>
>I was checking the code and came across this statement....
>
>
>IF (Thisform.m_seek(lcFullerRx,"rx_claim","fullerx",1)) AND (rx_claim.statuscode = 2) AND (rx_claim.n_103_a3 = "B1")
>
>
>Now, the m_seek does a seek, looking in the rx_claim table for a claim.
>Notice that the the second item is also from rx_claim, and is the third item.
>
>I was of the opinion that the processor would execute the code form left to right in the statement.... so the seek would FIND the correct rx_claim record first, THEN check to see if statuscode is 2 and n_103_a3 is 'B1".
>
>But is this always true? Is it possible that it can sometimes do the 2nd or 3rd item first, THEN do the seek????
>
>I just have a bad feeling about this, since the 2nd and 3rd item DEPEND upon the 1st ITEM......
>
>If so, I can rewrite the code to execute each thing in order......
>
>Thanks!
>Tommy
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform