This is a multi-part message in MIME format.

------=_NextPart_000_0006_01C5A28A.658070B0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I am just experimenting with this command. On a form with an editbox and =
a commandbutton I have this code in the commandbutton click()

_CLIPTEXT =3D "Hello world"=20
ThisForm.Edit1.SetFocus()
SYS(1500, '_MED_PASTE', '_MEDIT')
thisform.Refresh()

The first time I click the button the edit cursor appears in the edit =
box but nothing else. Thereafter every time I click the commandbutton, =
the phrase appears as expected in the edit box, concatenating with the =
previous paste..

Can somebody explain why it doesn't appear the first time?

Many thanks

Stephen

------=_NextPart_000_0006_01C5A28A.658070B0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2722" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I am just experimenting with this =
command. On a=20
form with an editbox and a commandbutton I have this code in the =
commandbutton=20
click()</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>_CLIPTEXT =3D "Hello world"=20
<BR>ThisForm.Edit1.SetFocus()<BR>SYS(1500, '_MED_PASTE',=20
'_MEDIT')<BR>thisform.Refresh()</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The first time I click the button the =
edit cursor=20
appears in the edit box but nothing else. Thereafter every time I click =
the=20
commandbutton, the phrase appears as expected in the edit box, =
concatenating=20
with the previous paste..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Can somebody explain why it doesn't =
appear the=20
first time?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Many thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Stephen</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0006_01C5A28A.658070B0--

Re: sys(1500) by Dan

Dan
Tue Aug 16 12:29:21 CDT 2005

Looks to me like paste is flaky -- or there may be a timing issue. I see the
same inconsistent behavior if I use KEYBOARD '{CTRL+v}' instead of the SYS()
function, but KEYBOARD (_CLIPTEXT) seems to work consistently.

Dan



Stephen & Shelagh Ibbs wrote:
> I am just experimenting with this command. On a form with an editbox
> and a commandbutton I have this code in the commandbutton click()
>
> _CLIPTEXT = "Hello world"
> ThisForm.Edit1.SetFocus()
> SYS(1500, '_MED_PASTE', '_MEDIT')
> thisform.Refresh()
>
> The first time I click the button the edit cursor appears in the edit
> box but nothing else. Thereafter every time I click the
> commandbutton, the phrase appears as expected in the edit box,
> concatenating with the previous paste..
>
> Can somebody explain why it doesn't appear the first time?
>
> Many thanks
>
> Stephen



Re: sys(1500) by Stephen

Stephen
Tue Aug 16 12:50:43 CDT 2005

Thanks Dan - it's nice to know that the flakiness is not just in my system
if you know what I mean.

Stephen

"Dan Freeman" <spam@microsoft.com> wrote in message
news:%23ieLLgooFHA.3084@TK2MSFTNGP09.phx.gbl...
> Looks to me like paste is flaky -- or there may be a timing issue. I see
> the
> same inconsistent behavior if I use KEYBOARD '{CTRL+v}' instead of the
> SYS()
> function, but KEYBOARD (_CLIPTEXT) seems to work consistently.
>
> Dan
>
>
>
> Stephen & Shelagh Ibbs wrote:
>> I am just experimenting with this command. On a form with an editbox
>> and a commandbutton I have this code in the commandbutton click()
>>
>> _CLIPTEXT = "Hello world"
>> ThisForm.Edit1.SetFocus()
>> SYS(1500, '_MED_PASTE', '_MEDIT')
>> thisform.Refresh()
>>
>> The first time I click the button the edit cursor appears in the edit
>> box but nothing else. Thereafter every time I click the
>> commandbutton, the phrase appears as expected in the edit box,
>> concatenating with the previous paste..
>>
>> Can somebody explain why it doesn't appear the first time?
>>
>> Many thanks
>>
>> Stephen
>
>



Re: sys(1500) by Stephen

Stephen
Tue Aug 16 13:21:54 CDT 2005

As a follow on, I thought you might be interested in the following, using
KEYBOARD

If you have this in the click method:

_CLIPTEXT = "Hello world"
ThisForm.Edit1.SetFocus()
KEYBOARD (_CLIPTEXT)

everything works correctly. However if you have this:

_CLIPTEXT = "Hello world"
ThisForm.Edit1.SetFocus()
KEYBOARD (_CLIPTEXT)
WAIT WINDOW "Finished"

you will find that the first letter 'H' has been lost from the phrase, and
the wait window does not appear.

Weird.

Stephen


"Dan Freeman" <spam@microsoft.com> wrote in message
news:%23ieLLgooFHA.3084@TK2MSFTNGP09.phx.gbl...
> Looks to me like paste is flaky -- or there may be a timing issue. I see
> the
> same inconsistent behavior if I use KEYBOARD '{CTRL+v}' instead of the
> SYS()
> function, but KEYBOARD (_CLIPTEXT) seems to work consistently.
>
> Dan
>
>
>
> Stephen & Shelagh Ibbs wrote:
>> I am just experimenting with this command. On a form with an editbox
>> and a commandbutton I have this code in the commandbutton click()
>>
>> _CLIPTEXT = "Hello world"
>> ThisForm.Edit1.SetFocus()
>> SYS(1500, '_MED_PASTE', '_MEDIT')
>> thisform.Refresh()
>>
>> The first time I click the button the edit cursor appears in the edit
>> box but nothing else. Thereafter every time I click the
>> commandbutton, the phrase appears as expected in the edit box,
>> concatenating with the previous paste..
>>
>> Can somebody explain why it doesn't appear the first time?
>>
>> Many thanks
>>
>> Stephen
>
>



Re: sys(1500) by Bernhard

Bernhard
Tue Aug 16 14:43:45 CDT 2005

Hi Stephen

> _CLIPTEXT = "Hello world"
> ThisForm.Edit1.SetFocus()
> KEYBOARD (_CLIPTEXT)
> WAIT WINDOW "Finished"
>
> you will find that the first letter 'H' has been lost from the phrase, and
> the wait window does not appear.
This is, how the KEYBOARD command works.
At the line KEYBOARD (_CLIPTEXT) all the contents of the clipboard is stuffed
into the keyboard buffer. Nothing else. The next time, where foxpro waits for
some input, the contents of the keyboard buffer is "played": So, the first
keystroke-eating-thing is your WAIT WINDOW command. It takes the first character
from the keyboard buffer, in your case the "H". The rest will flow into the edit
box.

Regards
Bernhard Sander

Re: sys(1500) by Dan

Dan
Tue Aug 16 15:51:46 CDT 2005

Bernhard explained it.

Again it's a timing thing. If you're going to stuff the keyboard buffer, you
have to then let VFP use the keystrokes before putting it in a different
state (Wait Window) that will ALSO use keystrokes.

Dan

Stephen & Shelagh Ibbs wrote:
> As a follow on, I thought you might be interested in the following,
> using KEYBOARD
>
> If you have this in the click method:
>
> _CLIPTEXT = "Hello world"
> ThisForm.Edit1.SetFocus()
> KEYBOARD (_CLIPTEXT)
>
> everything works correctly. However if you have this:
>
> _CLIPTEXT = "Hello world"
> ThisForm.Edit1.SetFocus()
> KEYBOARD (_CLIPTEXT)
> WAIT WINDOW "Finished"
>
> you will find that the first letter 'H' has been lost from the
> phrase, and the wait window does not appear.
>
> Weird.
>
> Stephen
>
>
> "Dan Freeman" <spam@microsoft.com> wrote in message
> news:%23ieLLgooFHA.3084@TK2MSFTNGP09.phx.gbl...
>> Looks to me like paste is flaky -- or there may be a timing issue. I
>> see the
>> same inconsistent behavior if I use KEYBOARD '{CTRL+v}' instead of
>> the SYS()
>> function, but KEYBOARD (_CLIPTEXT) seems to work consistently.
>>
>> Dan
>>
>>
>>
>> Stephen & Shelagh Ibbs wrote:
>>> I am just experimenting with this command. On a form with an editbox
>>> and a commandbutton I have this code in the commandbutton click()
>>>
>>> _CLIPTEXT = "Hello world"
>>> ThisForm.Edit1.SetFocus()
>>> SYS(1500, '_MED_PASTE', '_MEDIT')
>>> thisform.Refresh()
>>>
>>> The first time I click the button the edit cursor appears in the
>>> edit box but nothing else. Thereafter every time I click the
>>> commandbutton, the phrase appears as expected in the edit box,
>>> concatenating with the previous paste..
>>>
>>> Can somebody explain why it doesn't appear the first time?
>>>
>>> Many thanks
>>>
>>> Stephen



Re: sys(1500) by Stephen

Stephen
Tue Aug 16 16:35:38 CDT 2005

Many thanks both for explaining it. The original issue occurred just out of
curiosity as to how sys(1500) worked - or didn't, consistently..

Stephen

"Dan Freeman" <spam@microsoft.com> wrote in message
news:u97fSRqoFHA.2080@TK2MSFTNGP14.phx.gbl...
> Bernhard explained it.
>
> Again it's a timing thing. If you're going to stuff the keyboard buffer,
> you
> have to then let VFP use the keystrokes before putting it in a different
> state (Wait Window) that will ALSO use keystrokes.
>
> Dan
>
> Stephen & Shelagh Ibbs wrote:
>> As a follow on, I thought you might be interested in the following,
>> using KEYBOARD
>>
>> If you have this in the click method:
>>
>> _CLIPTEXT = "Hello world"
>> ThisForm.Edit1.SetFocus()
>> KEYBOARD (_CLIPTEXT)
>>
>> everything works correctly. However if you have this:
>>
>> _CLIPTEXT = "Hello world"
>> ThisForm.Edit1.SetFocus()
>> KEYBOARD (_CLIPTEXT)
>> WAIT WINDOW "Finished"
>>
>> you will find that the first letter 'H' has been lost from the
>> phrase, and the wait window does not appear.
>>
>> Weird.
>>
>> Stephen
>>
>>
>> "Dan Freeman" <spam@microsoft.com> wrote in message
>> news:%23ieLLgooFHA.3084@TK2MSFTNGP09.phx.gbl...
>>> Looks to me like paste is flaky -- or there may be a timing issue. I
>>> see the
>>> same inconsistent behavior if I use KEYBOARD '{CTRL+v}' instead of
>>> the SYS()
>>> function, but KEYBOARD (_CLIPTEXT) seems to work consistently.
>>>
>>> Dan
>>>
>>>
>>>
>>> Stephen & Shelagh Ibbs wrote:
>>>> I am just experimenting with this command. On a form with an editbox
>>>> and a commandbutton I have this code in the commandbutton click()
>>>>
>>>> _CLIPTEXT = "Hello world"
>>>> ThisForm.Edit1.SetFocus()
>>>> SYS(1500, '_MED_PASTE', '_MEDIT')
>>>> thisform.Refresh()
>>>>
>>>> The first time I click the button the edit cursor appears in the
>>>> edit box but nothing else. Thereafter every time I click the
>>>> commandbutton, the phrase appears as expected in the edit box,
>>>> concatenating with the previous paste..
>>>>
>>>> Can somebody explain why it doesn't appear the first time?
>>>>
>>>> Many thanks
>>>>
>>>> Stephen
>
>