Index
2014-03-25 14:23Sytze de Boer : Inserting a date
2014-03-25 14:30Stephen Russell : Re: Inserting a date
2014-03-25 14:47Fred Taylor : Re: Inserting a date
2014-03-25 14:52Jean MAURICE : Re: Inserting a date
2014-03-25 14:54Richard Kaye : RE: Inserting a date
2014-03-25 15:02Frank Cazabon : Re: Inserting a date
2014-03-25 15:03Fred Taylor : Re: Inserting a date
2014-03-25 15:04Fred Taylor : Re: Inserting a date
2014-03-25 15:26Jean MAURICE : Re: Inserting a date
2014-03-25 15:42Sytze de Boer : Re: Inserting a date
Back to top
Inserting a date

Author: Sytze de Boer

Posted: 2014-03-25 14:23:05   Link

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.

©2014 Sytze de Boer
Back to top
Re: Inserting a date

Author: Stephen Russell

Posted: 2014-03-25 14:30:33   Link

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.

©2014 Stephen Russell
Back to top
Re: Inserting a date

Author: Fred Taylor

Posted: 2014-03-25 14:47:41   Link

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.

©2014 Fred Taylor
Back to top
Re: Inserting a date

Author: Jean MAURICE

Posted: 2014-03-25 14:52:53   Link

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.

©2014 Jean MAURICE
Back to top
RE: Inserting a date

Author: Richard Kaye

Posted: 2014-03-25 14:54:57   Link

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.

©2014 Richard Kaye
Back to top
Re: Inserting a date

Author: Frank Cazabon

Posted: 2014-03-25 15:02:47   Link

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.

©2014 Frank Cazabon
Back to top
Re: Inserting a date

Author: Fred Taylor

Posted: 2014-03-25 15:03:09   Link

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.

©2014 Fred Taylor
Back to top
Re: Inserting a date

Author: Fred Taylor

Posted: 2014-03-25 15:04:24   Link

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.

©2014 Fred Taylor
Back to top
Re: Inserting a date

Author: Jean MAURICE

Posted: 2014-03-25 15:26:49   Link

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.

©2014 Jean MAURICE
Back to top
Re: Inserting a date

Author: Sytze de Boer

Posted: 2014-03-25 15:42:27   Link

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.

©2014 Sytze de Boer