Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code it better
Message
From
19/08/2008 13:29:27
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01339981
Message ID:
01340020
Views:
14
>>>I think the second variation is OK as is. What is the bigger picture?
>>
>>Isn't
>>
>>IF [U] <> TYPE([X1.X2...Xn])
>>
>>much simpler than
>>
>>IF PEMSTATUS(X1, [X2], 5) AND PEMSTATUS(X1.X2, [X3], 5) AND ... PEMSTATUS(X1.X2. ... .Xn-1, [Xn], 5)
>>
>>So when would one wants to use PEMSTATUS(,, 5) in a IF structure?
>
>If I recall correctly, PEMSTATUS works quicker than TYPE. So, if you need it in a loop you may use PEMSTATUS over TYPE (we do need some speed measurements here, I may be wrong).
>
But if the n is big, I wonder several calls to PEMSTATUS can still have perfromance advantage over a single call to TYPE.

>Also I use the other way around TYPE <> "U". Not sure if there is any difference at all, but in my opinion it's clearer this way.
>
em.. I got use to placing constant or manifest constant on the left side in a comparison expression... can't recall since when, something like I read an article which convince me it is better that way.
Btw, when I search my drive with code reference for codes which I type() test object item, I find myself lucky because I have the above habit.
I search for "[O] = TYPE(" and I got quite an exact list of what I am interested in.

If I were placing the "U" like you do on the right side of the operator ... then the best way I can think of is to search for "TYPE(" (I wonder code reference supports regular expression...), but then I will have a long list of type() testing for all TYPEs. <g>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform