Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Separate the strings
Message
From
25/03/2016 09:44:31
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
25/03/2016 09:07:59
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01633712
Message ID:
01633735
Views:
75
>>
>>local accounts,y
>>m.accounts='100,1100,200,250,3000'
>>
>>m.y=""
>>for i=1 to  getwordcount(accounts,',')
>>m.y=m.y+"accounsts["+trans(i)+"]="+getwordnum(accounts,i,',')+chr(13)
>>endfor
>>_cliptext=m.y
>>messagebox(m.y,"string in clipboard")
>>
>
>This way is much slower than ALINES().
>
>Tamar


Tamar,

I run into that trap at first, but then I have canceled my reply.

You have missed the Yousfi created a string that , printed, looks like the array.
What he creates is similar to
TEXT TO y
account[1]=100
account[2]=1100
account[3]=200
account[4]=250
account[5]=3000
ENDTEXT
I guess this is not the solution the OP had in mind, but it is nice, anyway.

The solution is wrong too, because it should be
TEXT TO y
account[1]='100'
account[2]='1100'
account[3]='200'
account[4]='250'
account[5]='3000'
ENDTEXT
at least.

Also I prefer CHR(13)+CHR(10) on (Win)DOS machines.

:D
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform