Hi folk
In a new system I'm developing, I have a form with provision for a large
edit box
When a person is typing in this box, I want them to be able to insert a
date at the point where the cursor is.
So, in the *when* procedure, I have it where if the person presses F5, it
inserts the date.
The problem is, it inserts the date at the beginning of the Edit box
instead of where the cursor is. Can someone help me out with this ?
--
Kind regards
Sytze de Boer
Kiss Software
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAG1nNy8eHDba8RPgXLXqg-BgxS95NvvcE=YExJQrNu-NV_-yEw@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
On Tue, Mar 25, 2014 at 2:23 PM, Sytze de Boer <sytze.kiss@gmail.com> wrote:
> Hi folk
> In a new system I'm developing, I have a form with provision for a large
> edit box
> When a person is typing in this box, I want them to be able to insert a
> date at the point where the cursor is.
> So, in the *when* procedure, I have it where if the person presses F5, it
> inserts the date.
> The problem is, it inserts the date at the beginning of the Edit box
> instead of where the cursor is. Can someone help me out with this ?
>
> -------------
Only guessing that you can grab to the clipboard all text before the
cursor, get a len() of it and then substring() what you want in there.
--
Stephen Russell
Sr. Analyst
Ring Container Technology
Oakland TN
901.246-0159 cell
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAJidMYKOF98eT8x8QXrSeCvw2p78PyFpBfo3t5UnFcPSKmDt1Q@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
What are you doing to insert the date?
Fred
On Tue, Mar 25, 2014 at 12:23 PM, Sytze de Boer <sytze.kiss@gmail.com>wrote:
> Hi folk
> In a new system I'm developing, I have a form with provision for a large
> edit box
> When a person is typing in this box, I want them to be able to insert a
> date at the point where the cursor is.
> So, in the *when* procedure, I have it where if the person presses F5, it
> inserts the date.
> The problem is, it inserts the date at the beginning of the Edit box
> instead of where the cursor is. Can someone help me out with this ?
>
>
> --
> Kind regards
> Sytze de Boer
> Kiss Software
>
>
> --- StripMime Report -- processed MIME parts ---
> multipart/alternative
> text/plain (text body -- kept)
> text/html
> ---
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAJCBksocgQkHDitq7_81zZ5WrMa-SjdbSC+4RfEh2W-PfvjG6A@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
I think the best way to do this is to do a 'good old'
KEYBOARD DTOC(date())
In the F5 key ...
The Foxil
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/5331DE95.2080403@wanadoo.fr
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
You should use the KEYPRESS event, not the WHEN.
--
rk
-----Original Message-----
From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Sytze de Boer
Sent: Tuesday, March 25, 2014 3:23 PM
To: profoxtech@leafe.com
Subject: Inserting a date
Hi folk
In a new system I'm developing, I have a form with provision for a large edit box When a person is typing in this box, I want them to be able to insert a date at the point where the cursor is.
So, in the *when* procedure, I have it where if the person presses F5, it inserts the date.
The problem is, it inserts the date at the beginning of the Edit box instead of where the cursor is. Can someone help me out with this ?
--
Kind regards
Sytze de Boer
Kiss Software
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/DF1EEF11E586A64FB54A97F22A8BD04422A727A6E5@ACKBWDDQH1.artfact.local
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
On 25/03/2014 03:23 PM, Sytze de Boer wrote:
> Hi folk
> In a new system I'm developing, I have a form with provision for a large
> edit box
> When a person is typing in this box, I want them to be able to insert a
> date at the point where the cursor is.
> So, in the *when* procedure, I have it where if the person presses F5, it
> inserts the date.
> The problem is, it inserts the date at the beginning of the Edit box
> instead of where the cursor is. Can someone help me out with this ?
>
>
Sytze,
something like this should work in your edit box's KeyPress event:
LPARAMETERS nKeyCode, nShiftAltCtrl
#define F5 -4
IF m.nKeyCode = F5
this.Value = SUBSTR(this.Value, 1, this.SelStart) +
TRANSFORM(DATETIME()) + SUBSTR(this.Value, this.SelStart + 1)
ENDIF
--
Frank.
Frank Cazabon
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/5331E0E7.1040006@gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Code for the EditBox.KeyPress:
LPARAMETERS nKeyCode, nShiftAltCtrl
IF m.nShiftAltCtrl=0 AND m.nKeyCode=-4 && F5
NODEFAULT
this.Value = STUFF(this.Value,this.SelStart+1,0,DTOC(DATE()))
ENDIF
Fred
On Tue, Mar 25, 2014 at 12:23 PM, Sytze de Boer <sytze.kiss@gmail.com>wrote:
> Hi folk
> In a new system I'm developing, I have a form with provision for a large
> edit box
> When a person is typing in this box, I want them to be able to insert a
> date at the point where the cursor is.
> So, in the *when* procedure, I have it where if the person presses F5, it
> inserts the date.
> The problem is, it inserts the date at the beginning of the Edit box
> instead of where the cursor is. Can someone help me out with this ?
>
>
> --
> Kind regards
> Sytze de Boer
> Kiss Software
>
>
> --- StripMime Report -- processed MIME parts ---
> multipart/alternative
> text/plain (text body -- kept)
> text/html
> ---
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAJCBksq_PoOvsogec2VsCnamb-=gQ9cmZKgbL73=q2kvsXwsWg@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Won't work if the insert mode is in overstrike, data would be overwritten.
Fred
On Tue, Mar 25, 2014 at 12:52 PM, Jean MAURICE <jsm.maurice@wanadoo.fr>wrote:
> I think the best way to do this is to do a 'good old'
>
> KEYBOARD DTOC(date())
>
> In the F5 key ...
>
> The Foxil
>
>
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAJCBkspLLPhBQ5k8QKdi3=Moe8tNN-z1PxxLb-uW7=EetvYLNA@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
That's right ! I did not think about that ...
The Foxil
Le 25/03/2014 21:04, Fred Taylor a écrit :
> Won't work if the insert mode is in overstrike, data would be overwritten.
>
> Fred
>
>
> On Tue, Mar 25, 2014 at 12:52 PM, Jean MAURICE <jsm.maurice@wanadoo.fr>wrote:
>
>> I think the best way to do this is to do a 'good old'
>>
>> KEYBOARD DTOC(date())
>>
>> In the F5 key ...
>>
>> The Foxil
>>
>>
>>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/5331E689.1090005@wanadoo.fr
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Hi folk
I have something working which does it for the moment
In the When I have ON KEY LABEL F5 do sas144
This is turned on Valid
Sas144.prg goes:
IF !EMPTY(notes)
replace notes with ALLTRIM(notes)+CHR(13)+DTOC(sysdate)+CHR(13)
ELSE
replace notes with DTOC(sysdate)+CHR(13)
ENDIF
The only annoying thing with this is the cursor keeps going to beginning of
the Edit field
I think I've read how you can "position" the cursor at the end of the memo,
but I'll leave that for another day.
On Wed, Mar 26, 2014 at 9:26 AM, Jean MAURICE <jsm.maurice@wanadoo.fr>wrote:
> That's right ! I did not think about that ...
>
> The Foxil
>
> Le 25/03/2014 21:04, Fred Taylor a écrit :
>
> Won't work if the insert mode is in overstrike, data would be overwritten.
>>
>> Fred
>>
>>
>> On Tue, Mar 25, 2014 at 12:52 PM, Jean MAURICE <jsm.maurice@wanadoo.fr
>> >wrote:
>>
>> I think the best way to do this is to do a 'good old'
>>>
>>> KEYBOARD DTOC(date())
>>>
>>> In the F5 key ...
>>>
>>> The Foxil
>>>
>>>
>>>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAG1nNy-cpjH1gTigL5C6oyEh=nq5NysMkiyvaMAdo9JkNjs5BQ@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.