Results 1 to 2 of 2

Thread: Question about Copy and paste

  1. #1
    Guest

    Post

    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

  2. #2
    Lively Member
    Join Date
    Jun 1999
    Location
    Ireland
    Posts
    96

    Post

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width