Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PushButton for copying to clipboard

3 views
Skip to first unread message

marv...@capital.net

unread,
Jan 24, 2001, 11:07:59 AM1/24/01
to
Hello,
How do I code a pushButton event that copies selected field data to the
clipboard.
I want to copy the name and address of one customer at time for later
pasting into a wordprocessor letter.
I have tried the following from the help file (replacing "mystrings.db"
and "stringField" appropriately) but it doesn't seem to cooperate:
Thank you,
Phil
===========================
method pushButton(var eventInfo Event)
var
vrString String
tcString TCursor
endVar

;// Open table to which contains strings
tcString.open("mystrings.db")
;// Make sure there is data in the table
if tcString.nRecords() <> 0 then
;// Copy a value to the String variable
vrString = tcString.stringField
;// Write it out to the Clipboard
vrString.writeToClipboard()
endIf
tcString.close()
endMethod

Liz

unread,
Jan 24, 2001, 9:32:34 AM1/24/01
to
Phil,

Looks ok to me. What do you mean by not cooperating? Have you
tried just doing:

vrString = "This is a test"
vrString.writeToClipboard()

...and then open Notepad and hit Ctrl+V to paste and see if you
get "This is a test" pasted in...

Liz

marv...@capital.net

unread,
Jan 24, 2001, 3:56:02 PM1/24/01
to
> Thank you Liz,
> Yes, "This is a test" does go to the clipboard as you predicted.
> But, if I specify our "Lastname" field in place of "stringField", what gets
>
> copied to the clipboard is the first alphabetical Lastname in the table
> ("Aarons"),
> regardless of which record I am looking at when I push the button.
> Also, I don't know how to get several fields to copy (Firstname, Lastname,
> Address, City, State, Zip) at the same time with one push.
> I appreciate your help.
> Phil
> ==================

Lorrin Moore

unread,
Jan 24, 2001, 1:28:45 PM1/24/01
to
Use a report in Paradox or mail-merge in WordPerfect

--
Lorrin (filter the spam to reply)

<marv...@capital.net> wrote in message
news:3A6F4162...@capital.net...

Jeff Shoaf

unread,
Jan 24, 2001, 1:55:52 PM1/24/01
to
The code in the help file clip you provided is using a tCursor. If you're
trying to put data from a form in the clipboard, you'll need to reference
the names of the field objects on the form rather than opening a tCursor and
looping through it. Alternatively, you can open a tCursor and locate the
same record as is showing on the form, but that's just more code to get the
same data.

<marv...@capital.net> wrote in message
news:3A6F4162...@capital.net...

Bertil Isberg

unread,
Jan 24, 2001, 1:54:44 PM1/24/01
to
When you open a tcursor. it will always open on first record.

To get the record currentlöy shown in a form, you have to use
tcursor.attach(ObjectNameInForm) instead of tcursor.open()

--
Bertil Isberg CTECH
read the newsgroup: corelsupport.faqs.paradox
for Frequently Asked Questions
---------------------------------------------------
<marv...@capital.net> skrev i
diskussionsgruppsmeddelandet:3A6F4162...@capital.net...

marv...@capital.net

unread,
Jan 24, 2001, 5:35:48 PM1/24/01
to
Thank you everyone.
Some good suggestions to try.
Phil
=====================

Robert Harris

unread,
Jan 28, 2001, 6:43:08 PM1/28/01
to
For WordPerfect use

var
oleauto OLEAUTO
s1, s2 string
endvar

s1 = FirstName
s2 = Address,... etc


oleauto.open("Wordperfect.PerfectScript")
oleauto.type(s1)
oleauto.hardreturn()
oleauto.type(s2)
oleauto.close()

Presumably, one could also use other Wordprocessors besides WP.

raharris

<marv...@capital.net> wrote in message
news:3A6EFDDF...@capital.net...

0 new messages