Home > Archive > Programming with dBASE > October 2005 > Tab Challenge with Clipboard









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Tab Challenge with Clipboard
Jerry

2005-10-12, 11:24 am

I've got a challenge for those of you smarter than myself. I'm trying to
place a [TAB] key in the clipboard and then 'paste' that into other
programs. I can do that using the 'RETURN' key with the code below.

// MAINMENU.E_CLIPBOARD IS A ENTRYFIELD ON FORM MAINMENU
MAINMENU.E_CLIPBOARD.VALUE = 'TEST' + CHR(13) + 'SECOND LINE'
MAINMENU.E_CLIPBOARD.KEYBOARD("{HOME}{SHIFT-END}")
MAINMENU.E_CLIPBOARD.COPY()

When I press CTRL-V (to paste) - I get the following which is what I want

TEST
SECOND LINE

But watch what happens when I try to us a 'TAB' key

MAINMENU.E_CLIPBOARD.VALUE = 'TEST' + CHR(9) + 'SECOND FIELD'
MAINMENU.E_CLIPBOARD.KEYBOARD("{HOME}{SHIFT-END}")
MAINMENU.E_CLIPBOARD.COPY()

When I press CTRL-V - I get the following

TEST SECOND FIELD


I understand why this is happening but what I'm trying to acheive is to
paste the first word 'TEST' in a field box in another program and then to
implement a 'TAB' to go to the next field box and then paste 'SECOND FIELD'.
The KEYBOARD() function will do that but I only want this to occur when I
paste the clipboard.


Any suggestions for ideas will be greatly appreciated.


Jerry


Denis Finch

2005-10-17, 1:26 pm

How about creating a entryfield that is not visible to the user it has a
left value like -200 and make sure it has it's tabstop set to false. Set
the value that you want to paste into this entryfield and then use it to
paste your value to the clipboard.
"Jerry" <RivenbarkJerry@aol.com> wrote in message
news:PpfGxmrzFHA.2056@news-server...
> I've got a challenge for those of you smarter than myself. I'm trying to
> place a [TAB] key in the clipboard and then 'paste' that into other
> programs. I can do that using the 'RETURN' key with the code below.
>
> // MAINMENU.E_CLIPBOARD IS A ENTRYFIELD ON FORM MAINMENU
> MAINMENU.E_CLIPBOARD.VALUE = 'TEST' + CHR(13) + 'SECOND LINE'
> MAINMENU.E_CLIPBOARD.KEYBOARD("{HOME}{SHIFT-END}")
> MAINMENU.E_CLIPBOARD.COPY()
>
> When I press CTRL-V (to paste) - I get the following which is what I want
>
> TEST
> SECOND LINE
>
> But watch what happens when I try to us a 'TAB' key
>
> MAINMENU.E_CLIPBOARD.VALUE = 'TEST' + CHR(9) + 'SECOND FIELD'
> MAINMENU.E_CLIPBOARD.KEYBOARD("{HOME}{SHIFT-END}")
> MAINMENU.E_CLIPBOARD.COPY()
>
> When I press CTRL-V - I get the following
>
> TEST SECOND FIELD
>
>
> I understand why this is happening but what I'm trying to acheive is to
> paste the first word 'TEST' in a field box in another program and then to
> implement a 'TAB' to go to the next field box and then paste 'SECOND

FIELD'.
> The KEYBOARD() function will do that but I only want this to occur when I
> paste the clipboard.
>
>
> Any suggestions for ideas will be greatly appreciated.
>
>
> Jerry
>
>



Eric Logan

2005-10-17, 1:26 pm

This worked in Plus2.5:

f = new form()
e = new entryfield(f)
e.value = '2222'+chr(9)+'3333'

e.selectall = true
f.open()
e.setfocus()
e.copy()

E. L.

"Jerry" <RivenbarkJerry@aol.com> wrote in message
news:PpfGxmrzFHA.2056@news-server...
> I've got a challenge for those of you smarter than myself. I'm trying to
> place a [TAB] key in the clipboard and then 'paste' that into other
> programs. I can do that using the 'RETURN' key with the code below.
>
> // MAINMENU.E_CLIPBOARD IS A ENTRYFIELD ON FORM MAINMENU
> MAINMENU.E_CLIPBOARD.VALUE = 'TEST' + CHR(13) + 'SECOND LINE'
> MAINMENU.E_CLIPBOARD.KEYBOARD("{HOME}{SHIFT-END}")
> MAINMENU.E_CLIPBOARD.COPY()
>
> When I press CTRL-V (to paste) - I get the following which is what I want
>
> TEST
> SECOND LINE
>
> But watch what happens when I try to us a 'TAB' key
>
> MAINMENU.E_CLIPBOARD.VALUE = 'TEST' + CHR(9) + 'SECOND FIELD'
> MAINMENU.E_CLIPBOARD.KEYBOARD("{HOME}{SHIFT-END}")
> MAINMENU.E_CLIPBOARD.COPY()
>
> When I press CTRL-V - I get the following
>
> TEST SECOND FIELD
>
>
> I understand why this is happening but what I'm trying to acheive is to
> paste the first word 'TEST' in a field box in another program and then to
> implement a 'TAB' to go to the next field box and then paste 'SECOND

FIELD'.
> The KEYBOARD() function will do that but I only want this to occur when I
> paste the clipboard.
>
>
> Any suggestions for ideas will be greatly appreciated.
>
>
> Jerry
>
>



Jerry

2005-10-17, 1:26 pm

That was a good idea but when I swith to another application and paste from
the clipboard, the tab isn't there. Is there some API that can trigger a
tab?

Thanks for your post.


Jerry


"Eric Logan" <jelogan@pcweb.net> wrote in message
news:JUmC172zFHA.1244@news-server...
> This worked in Plus2.5:
>
> f = new form()
> e = new entryfield(f)
> e.value = '2222'+chr(9)+'3333'

> e.selectall = true
> f.open()
> e.setfocus()
> e.copy()
>
> E. L.
>
> "Jerry" <RivenbarkJerry@aol.com> wrote in message
> news:PpfGxmrzFHA.2056@news-server...
> FIELD'.
>
>



Eric Logan

2005-10-17, 1:26 pm

Jerry;
I am sure that the tab is in the clipboard, because when I paste the copied
string into an Excel spreadsheet, the part after the tab (chr(9)) goes into
the next cell. Excel interprets the tab as an instruction to jump to the
next cell, just as if you typed it.

Now, if you ask for a string containing tabs via commands in the dBase
command window (? '111'+chr(9)+'222'),
and then copy what you get from the
results pane using the mouse, I don't think you will get any tabs. The tabs
will have been interpreted (by dBase) as some number of spaces, which you
can specify in Properties/Command Window/Editor/. (Someone correct me if
there is a way to copy tabs from the results pane.)

In dBASE there are ways to programmatically copy stuff to the clipboard
without using the copy method of a form object. Check out clipboard.cc (and
dbmem.dll) in the dUFLP.
E.L.

"Jerry" wrote ...
> That was a good idea but when I swith to another application and paste

from
> the clipboard, the tab isn't there. Is there some API that can trigger a
> tab?




Jerry

2005-10-24, 8:24 pm

Hello Eric,

You are correct - I tried that as well and found that the {TAB} is in the
clipboard - apparently the program that I'm trying to paste into can't
handle these {TAB} instructions. At least now I know where the problem is.

Thanks for your advice on this matter,

Jerry


"Eric Logan" <jelogan@pcweb.net> wrote in message
news:hhfdr4D0FHA.1232@news-server...
> Jerry;
> I am sure that the tab is in the clipboard, because when I paste the
> copied
> string into an Excel spreadsheet, the part after the tab (chr(9)) goes
> into
> the next cell. Excel interprets the tab as an instruction to jump to the
> next cell, just as if you typed it.
>
> Now, if you ask for a string containing tabs via commands in the dBase
> command window (? '111'+chr(9)+'222'),
and then copy what you get from the
> results pane using the mouse, I don't think you will get any tabs. The
> tabs
> will have been interpreted (by dBase) as some number of spaces, which you
> can specify in Properties/Command Window/Editor/. (Someone correct me if
> there is a way to copy tabs from the results pane.)
>
> In dBASE there are ways to programmatically copy stuff to the clipboard
> without using the copy method of a form object. Check out clipboard.cc
> (and
> dbmem.dll) in the dUFLP.
> E.L.
>
> "Jerry" wrote ...
> from
>
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com