Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP7 - Success Story
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00568477
Message ID:
00568625
Views:
15
This message has been marked as a message which has helped to the initial question of the thread.
Hi Kirk.

>1. I store data in an ActiveX object as a delimited string. Parsing that string to get the right value took many lines of code and was hard to understand from a readability stand-point. Here is the function now:

I just love the new STREXTRACT() function. It gets rid of tons of hard-to-read (and write and maintain) string parsing code.

>3. ASCAN a column. The help for this is confusing to me, and there may be an even more direct way to do this, but I have an array and I know the data I'm looking for is in first column:
>
>
>	lnElement=ASCAN(arooms,ALLTRIM(ctSchedShow.RoomName),1,ALEN(arooms,1),1)
>	lnSubScript=ASUBSCRIPT(arooms,lnElement,1)
>	nCount=aRooms[lnSubScript,2]
>
You can pass -1 for the third and fourth parameters to basically say "ignore these, do the entire array". Another tip: include 8 in the last parameter to return the row number rather than the element number, and you can skip the call to ASUBSCRIPT:
lnRow=ASCAN(arooms,ALLTRIM(ctSchedShow.RoomName),-1,-1,1,8)
nCount=aRooms[lnRow,2]
The last parameter can also be used to make the search case-insensitive and to control the exactness setting.

Doug
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform