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.
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 desc3. 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.