Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_ClipText to Array and/or Cusor
Message
 
To
16/10/2006 13:17:13
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
MS SQL Server
Miscellaneous
Thread ID:
01162254
Message ID:
01162313
Views:
14
Here's a piece of code that I've done many things with, I've used it as a basis for a source code stripper but in this instance it can be used to put the lines into a cursor:
Y=strtran(_cliptext,CHR(9),SPACE(3))   && I dislike tabs in source ... they cause selection irregularities
FOR N=OCCURS(CHR(13),Y) TO 1 STEP -1   && loop through lines in source, make whitespace go away
   bol=IIF(N>1,ATC(CHR(13),Y,N-1)+1,1) && find beginning of line
   eol=ATC(CHR(13),Y,N)                && find end of line
   txtline=SUBSTR(Y,bol,eol-bol)       && determine text in line 

   * take the line and do something with it
   insert into 'mytable' (myfield) values (txtline)    && insert line into cursor
ENDFOR
Previous
Reply
Map
View

Click here to load this message in the networking platform