PDA

Click to See Complete Forum and Search --> : Question about Copy and paste


Dec 13th, 1999, 12:21 PM
lets say i copy a piece of paste into an text-box and it looks something like this


money
people
interest
12000
1000
10

how do i code the rpogram so that i hit an command button that he automaticly
put money with 12000 , people with 100 and interest with 10....in a way that it chnges the text box like this :

money 12000
people 1000
interest 10

and how do i transform a single line...like let's say i want to get the number 12000 transferred into an seperate textbox ?...

i've been trying for a couple of days now but i can't figure it out..if someone could help me underway it would be greatly apreciated...thx


------------------
if i wouldn't have lost my mind.i'd probebly know the answer

SteveS
Dec 13th, 1999, 01:15 PM
I have to assume that the data format is always of the same structure.

ie:
Object1
Object2
Object3
Object...
Amount1
Amount2
Amount3
Amount...

if so, then, when you paste the code onto your form, use the TextBox_Change Sub to capture the event.

Then do something like,

1. Obtain the number of lines in the pasted string (ie: The number of CR's) and create an array strPastedLine(0 to NumberOfLines)

2. Then,
For n = 1 to NumberOfLines/2
txtObject(n).Text = strPastedLine(n)
txtAmount(n).Text = strPastedLine(n + (NumberOfLines/2))
Next n

Hope this helps,
Steve.