Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need help parsing
Message
 
 
To
18/10/2000 18:02:52
Dave Nantais
Light speed database solutions
Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00429941
Message ID:
00431284
Views:
14
>>Yes there is a finite list currently; however, more word could be added at later time. I am thinking maybe maintain a table of the list so my user can add new name to the list. I can alway dump the value from the table into an array to compare against string somehow. As far as character lengths, the answer is no, I have seen words as long as 8 characters. Thanks for replying
>>
>>Nick Patel
>
>If you do not have an agreed upon length of the first entry... and you cannot get 'the gods of marketing' to agree on placing a space between the first entry and the second entry... then it is impossible to 'parse' unless you have a finite set of 'first entries' in a table.
>
> If you can get any of these agreed upon conditions then you can use OCCURS, ATC and various string manipulation functions to parse the required entries.
>
> In watching the performance of other parsing programs I believe Foxpro is much faster than ACCESS/VBA and Visual Basic 5/6. I have seen VB project managers allocate the parsing to a separate C++ dll because of VBs slow speed.
>
> It sounds as though the parsing you require is very simple though.. and with proper information foxpro should be able to perform it quickly and easily
Hi Dave,

If Nick has all these codes stored in a table, the next step is quite trivial:
    select code from LookCode into array aCodes
    lnLen=_tally && Number of possible codes
    use yourtable
    lnSize=0
     for i=1 to lnLen         
         lnPos=atc(alltrim(aCodes[i,1]),col7)
         if lnPos>0 && This code is found in COL7
          lnSize=lnSize+1
          dimension laPosCodes[lnSize,2] && Redemension array
          laPosCodes[lnSize,1]=alltrim(aCodes[i,1]) && Alltrim is important here
          laPosCodes[lnSize,2]= lnPos && Position in COL7
         endif 
     next
     =asort(laPosCodes,1,2) && Check help for asort, I'd like to sort by second index
   lnCol=0
   for i=1 to lnSize
       lnCol=lnCol1+1
       store evaluate('col'+transform(lnCol)) to &laPosCodes[i,1] && Note use of macro here
    next
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform