Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: How to put Down Arrow into clipboard

  1. #11

    Re: How to put Down Arrow into clipboard

    Thanks, Eros!

    The answer in one word is "SENDKEYS".

    Here is code, based upon both of ours, to do the narrowly-defined
    task that I had in mind.


    [code=thinbasic]uses "UI" '---Load user interface module
    uses "OS"

    'testqubejb.tbasic - Jonathan Berry 2007 hereby released into the public domain
    'UI code by Eros Olmi
    'exports a column (of numbers) from the clipboard to qubecalc, started from the
    'command prompt with a batch file qu [filename]. So look for "qu " in the win handle
    'runs rather more slowly than the sendkeys-only program sample of Eros Olmi
    'but faster and less error prone than retyping the numbers !!!

    dim clip as string = "empty"
    dim newclip as string = "empty"
    dim pars as integer
    dim i as integer

    clip = ClipBoard_GetText

    dim sTitleToFind as string value "...qu ..." '"...\QUBECALC.COM..." '---This is the string to find in window caption
    DIM whndl AS dword
    dim Counter as long

    '---Find QUBECALC window ...
    whndl = win_FindByTitle(sTitleToFind)

    '---If not found ...
    IF whndl = 0 THEN
    msgbox 0, _
    "Not able to find QUBECALC window." & $crlf & _
    "Please be sure QUBECALC window is opened and " & $CRLF & _
    "ready to receive input before executing this script."
    else
    '---If you are here, correct window was found
    msgbox 0, "Found at " & whndl

    '---Set QUBECALC window as foreground window (give it current focus)
    WIN_SETFOREGROUND(whndl)

    '---Pay attention to give some time to DOS application to perform requested operation
    ' giving SENDKEY some sleep time. 100 to 300 mSecs seems ok. Make your tests

    pars = parsecount (clip, $crlf)
    for i = 1 to pars
    newclip = parse$ (clip, $crlf, i)
    newclip = remove$ (newclip, ANY "$, ") & "{down}"
    sendkeys (newclip, 10)
    ' newclip = remove$ (newclip, ANY "$, ")
    ' sendkeys (newclip & "{down}", 10)
    ' using 10. It's slow no matter what number one uses. But slightly faster than sendkeys (newclip & "{down}", 10)
    next ' note next i produces an error message!

    msgbox 0, "All done. Bye"
    END IF[/code]

  2. #12
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: How to put Down Arrow into clipboard

    The answer in one word is "SENDKEYS".
    Yes, it is very powerful

    dim clip as string = "empty"
    Strange initialization here, unless it is exactly what you want

    next ' note next i produces an error message!
    In many BASIC languages (especially old ones) it is necessary to repeat the name of the variable controlling FOR/NEXT loops. thinBasic keep track of all FOR/NEXT nested loops so it is able to increment/decrement the relevant variable when a NEXT is encountered.

    I'm happy I could help.
    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Page 2 of 2 FirstFirst 12

Similar Threads

  1. getting info from the clipboard
    By stapper in forum UI (User Interface)
    Replies: 4
    Last Post: 08-08-2011, 20:23

Members who have read this thread: 1

Posting Permissions

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