Forums

Find answers, ask questions, and connect with our
community all around the world.

Home Forum Omnis General Forum Pasting from Clipboard into range of fields?

  • Pasting from Clipboard into range of fields?

    Posted by Allan Lombardi on April 5, 2024 at 1:53 pm

    I would like to be able to copy 8 cells in 1 row from an Excel spreadsheet (manually) and using a window button paste that data (numbers ranging from 0.00 to 999) into a range of 8 fields on the window of the current main file. I was thinking I might use a list as an intermediary (easier to code) but I can’t seem to find any relevant commands other than Paste from clipboard which does not seem to be delimiter smart. What might be the options? TIA, Allan.

    Götz Krija replied 3 months, 1 week ago 2 Members · 1 Reply
  • 1 Reply
  • Götz Krija

    Member
    April 8, 2024 at 9:05 am

    You could paste the clipboard into a character variable and then parse the string into a list using a Carriage Return as delimiter.

    The code should look something like this:

    Paste from clipboard charVar1
    Do listVar.$define(charVar1)
    Repeat
    Calculate charVar2 as strtok(‘charVar1’,chr(13))
    Do listVar.$add(charVar2)
    Until charVar2=”

Log in to reply.