Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP7 - Success Story
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
VFP7 - Success Story
Miscellaneous
Thread ID:
00568477
Message ID:
00568477
Views:
52
I just wanted to share some of my success with VFP7. I've taken a VFP6 application and started to migrate it to 7. I did that to make sure that every still worked. As I've done this, I have made modification to take advantage of a couple of the new VFP7 features. All of these things are behind the scenes, the user don't see them, but they reduce code and improve readability if not performace.

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:
PARAMETERS tiItemID,tcBarCargo
LOCAL lcReturn
* 1=Surgeon
* 2=Procedure
* 3=Patient
* 4=Equipment
* 5=Referring Doctor Name
* 6=Date
* 7=Dept
* 8=DOB
* 9=Gender
* 10=ISBLOCK

lcReturn=""
lcReturn=STREXTRACT(tcBarCargo,"|","|",tiItemID)
RETURN (lcReturn)
Now if I add more information to the string, I don't have to figure out the position of where it starts and ends, etc.

2. The READWRITE function of the select into cursor. This ability, allows me to create a temporary cursor based on a union select statement from data from a seperate DBC and create multiple tags on the cursor. This is a lookup table I create at the beginning of the application:
SELECT PADR(dcode,15) AS dcode1,DESCRIPTIO  ;
	FROM &lcProcDBF  ;
	UNION ALL  ;
	SELECT PADR(dcode,15)  AS dcode1,procalias ;
	FROM &lcProcADBF  ORDER BY 2 ;
	INTO CURSOR proclook READWRITE

SELECT proclook
INDEX ON dcode1 TAG dcode
INDEX ON descriptio TAG desc
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]
Before this, I have always used a for/loop. This seems much easier.


I've also played with consuming some web services and they work, I have no practical use for them at the moment, but someday I can see how they may be very helpful.

Kirk Kelly
Next
Reply
Map
View

Click here to load this message in the networking platform