Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Undocumented feature of TYPE()
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Undocumented feature of TYPE()
Miscellaneous
Thread ID:
00343257
Message ID:
00343257
Views:
41
Hi All,
I got a good response the last time I posted an undocumented feature so I thought I would try it again.

The Type() function is a powerful little item. The VFP help gives a thorough listing of the return values:
Character C
Numeric (also float, double, and integer) N
Currency Y
Date D
DateTime T
Logical L
Memo M
Object O
General G
Screen (created with SAVE SCREEN) S
Undefined type of expression U

Or at least I thought it was thorough. It can also return an A for array. The example I use involves using ADSI.
lcADSIObj = "WinNT://mymachine/me"
ouser = getobject(lcADSIObj)
lcschema = ouser.Schema
oschema = getobject(lcschema)
if vartype(ouser) = "O" then
   * check to make sure the array property is not empty
   * TYPE() returns 'A' for non-empty COM arrays (from observation)
   if type("oSchema.MandatoryProperties") = "A" then
      for each oProperty in oSchema.MandatoryProperties
         ? oProperty + " - " + transform(ouser.get(oProperty))
      endfor
   endif
endif
Is this C++ thing again? Do you think it's a prblem with the documentation or a problem with te Type() function itself.

Thoughts? Comments?
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Reply
Map
View

Click here to load this message in the networking platform