Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Whether to Use an Array or a Cursor ?
Message
From
12/02/2014 03:43:59
 
 
To
11/02/2014 13:44:54
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01580497
Message ID:
01594118
Views:
101
Harsh, please pardon the pun, but why do you use such harsh words against Gregory? He has given you two very good advices, and you mock him? Has something happened without me noticing it?

>Thanks for commenting an Idiom. Unfortunately there is no filter in this forum that could restrain my messages to get into your inbox else I would have never asked support from a person who leads horses, as you commented yourself.
>
>Asking a question is my right on this forum replying to it is not mandatory at your part. However. Commenting an idiom on others and provoking others as you did is really a bad habit. So Leave it, its an advice.
>
>Here at our place we don't have ample support on Programming, nor We have undergone any proper training as it is not properly available here. So I would be asking questions in this Forum and I feel that there are enough sensible persons available in this forum to help others.
>
>If my Messages are annoying you I request you to kindly get a filter for my Mails or ask administrator to do so for your inbox , because I would be posting my queries as and when I will seek help. Though I also trying hard to learn also.
>
>Regards.
>Harsh
>
>
>
>
>
>
>
>
>
>>Consider
>>
>>(1) Structuring the code - don't know whether you'll still understand the code in a month or so
>> Create a class, add methods
>>
>>(2) Using regular expressions instead of wordnum/strextract/at and the like. They will make the work easier and easier to understand
>>
>>
>>
>>
>>
>>>I am trying to some Extract Data from a Text file and preform some Manipulation on it.
>>>
>>>For Extraction of Data I have two options, 1st create a cursor using Append from abc.txt SDF and Use The Locate Command to find my Data inside and extract it.
>>>
>>>2nd Use an Array. Initially I opted the second option. Now, to extract the Data from The array I am Scaning the entire Array from top Until the record is Matched, but since the volume of Data to be extracted from ech file and the number of files are also too Large, its taking huge time for entire processing.
>>>
>>>Alternatively, now i am thinking to take the data of each file in cursor and Use LOCATE FOR Command.
>>>
>>>What would be More Faster Mode or what should I do ?
>>>
>>>Here's a small portion of my current code. Should I Continue with Array or Cursor ?
>>>
>>>
>>>*****************Extract Usage Charges From PS File******************
>>>cExit='N'
>>>lnRowposition=10000
>>>
>>>FOR I= 1 TO nU1 && nU1 is the Length of Array
>>>IF 'Usage Charges' $ laArray(I)=.T.
>>>lnRowposition =    VAL(GETWORDNUM(laArray(I), GETWORDCOUNT(laArray(I)) - 1)) && The second last word
>>>lnLeftColumnposition = GETWORDNUM(laArray(I), GETWORDCOUNT(laArray(I)) - 2) && The Third last word
>>>lnLeftColumnposition=VAL(STREXTRACT(lnLeftColumnposition,')',''))
>>>EXIT
>>>ENDIF
>>>ENDFOR
>>>
>>>FOR nFor=-1 TO 1
>>>lcRowposition=ALLTRIM(STR(lnRowposition+nFor))+' x'
>>>FOR I= 1 TO nU1
>>>IF lcRowposition $ laArray(I)=.T.
>>>lnRightColumnposition=GETWORDNUM(laArray(I), GETWORDCOUNT(laArray(I)) - 2) && The Third last word
>>>lnRightColumnposition=VAL(STREXTRACT(lnRightColumnposition,')',''))
>>>IF lnRightColumnposition>lnLeftColumnposition
>>>IF TYPE(STREXTRACT(laArray(I),'(',')'))='N'
>>>nUsagecharges=VAL(STREXTRACT(laArray(I),'(',')'))
>>>cEXit='Y'
>>>EXIT
>>>ENDIF
>>>ENDIF
>>>ENDIF
>>>IF cExit='Y'
>>>EXIT
>>>ENDIF
>>>ENDFOR
>>>ENDFOR
>>>************************************************************************
>>>*****************Extract Balance Minimum Guarantee PS File******************
>>>cExit='N'
>>>lnRowposition=10000
>>>
>>>FOR I= 1 TO nU1
>>>IF 'Minimum Guarantee' $ laArray(I)=.T.
>>>lnRowposition =    VAL(GETWORDNUM(laArray(I), GETWORDCOUNT(laArray(I)) - 1)) && The second last word
>>>lnLeftColumnposition = GETWORDNUM(laArray(I), GETWORDCOUNT(laArray(I)) - 2) && The Third last word
>>>lnLeftColumnposition=VAL(STREXTRACT(lnLeftColumnposition,')',''))
>>>EXIT
>>>ENDIF
>>>ENDFOR
>>>
>>>FOR nFor=-1 TO 1
>>>lcRowposition=ALLTRIM(STR(lnRowposition+nFor))+' x'
>>>FOR I= 1 TO nU1
>>>IF lcRowposition $ laArray(I)=.T.
>>>lnRightColumnposition=GETWORDNUM(laArray(I), GETWORDCOUNT(laArray(I)) - 2) && The Third last word
>>>lnRightColumnposition=VAL(STREXTRACT(lnRightColumnposition,')',''))
>>>IF lnRightColumnposition>lnLeftColumnposition
>>>IF TYPE(STREXTRACT(laArray(I),'(',')'))='N'
>>>nBalMinimumGuarantee=VAL(STREXTRACT(laArray(I),'(',')'))
>>>cEXit='Y'
>>>EXIT
>>>ENDIF
>>>ENDIF
>>>ENDIF
>>>IF cExit='Y'
>>>EXIT
>>>ENDIF
>>>ENDFOR
>>>ENDFOR
>>>************************************************************************
>>>
>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform