Re: Inserting a date

2014-03-27 Thread Ted Roche
On 03/25/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

Re: Inserting a date

2014-03-27 Thread Fred Taylor
Thanks for the reminder, Ted. I just recently ran into the SET FUNCTION code setting keys in converting an old DOS app into VFP. I wondered what the difference was between SET FUNCTION and OKL. Fred On Thu, Mar 27, 2014 at 11:04 AM, Ted Roche tedro...@gmail.com wrote: On 03/25/2014 03:23

Re: Inserting a date

2014-03-27 Thread Stephen Russell
On Thu, Mar 27, 2014 at 1:10 PM, Fred Taylor fbtay...@gmail.com wrote: Thanks for the reminder, Ted. I just recently ran into the SET FUNCTION code setting keys in converting an old DOS app into VFP. I wondered what the difference was between SET FUNCTION and OKL. I think

Re: Inserting a date

2014-03-27 Thread Ted Roche
On 03/27/2014 02:10 PM, Fred Taylor wrote: Thanks for the reminder, Ted. I just recently ran into the SET FUNCTION code setting keys in converting an old DOS app into VFP. I wondered what the difference was between SET FUNCTION and OKL. Fred Set function is the command equivalent of Record

RE: Inserting a date

2014-03-26 Thread Ali Ihsan Turkoglu
Editbox When Method: On key label F5 keyboard dtoc(date()) Lostfocus Method: On key label F5 -Original Message- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Sytze de Boer Sent: Tuesday, March 25, 2014 9:23 PM To: profoxt...@leafe.com Subject: Inserting

Inserting a date

2014-03-25 Thread Sytze de Boer
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

Re: Inserting a date

2014-03-25 Thread Stephen Russell
On Tue, Mar 25, 2014 at 2:23 PM, Sytze de Boer sytze.k...@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

Re: Inserting a date

2014-03-25 Thread Fred Taylor
What are you doing to insert the date? Fred On Tue, Mar 25, 2014 at 12:23 PM, Sytze de Boer sytze.k...@gmail.comwrote: 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

Re: Inserting a date

2014-03-25 Thread Jean MAURICE
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:

Re: Inserting a date

2014-03-25 Thread Frank Cazabon
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

Re: Inserting a date

2014-03-25 Thread Fred Taylor
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.k...@gmail.comwrote: Hi folk In a new

RE: Inserting a date

2014-03-25 Thread Richard Kaye
You should use the KEYPRESS event, not the WHEN. -- rk -Original Message- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Sytze de Boer Sent: Tuesday, March 25, 2014 3:23 PM To: profoxt...@leafe.com Subject: Inserting a date Hi folk In a new system I'm developing

Re: Inserting a date

2014-03-25 Thread Fred Taylor
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.maur...@wanadoo.frwrote: 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

Re: Inserting a date

2014-03-25 Thread Jean MAURICE
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.maur...@wanadoo.frwrote: I think the best way to do this is

Re: Inserting a date

2014-03-25 Thread Sytze de Boer
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

Re: Inserting a date

2014-03-25 Thread Fred Taylor
You can position the cursor in the EditBox by setting the SelStart property. Note that .SelStart is 0 is at the beginning of the field. Fred On Tue, Mar 25, 2014 at 1:42 PM, Sytze de Boer sytze.k...@gmail.com wrote: Hi folk I have something working which does it for the moment In the When

Re: Inserting a date

2014-03-25 Thread Gérard Lochon
- Original Message - From: Jean MAURICE jsm.maur...@wanadoo.fr To: profox@leafe.com Sent: Tuesday, March 25, 2014 9:26 PM Subject: Re: Inserting a date 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

RE: Inserting a date

2014-03-25 Thread Tracy Pearson
LOCAL edt as EditBox edt = _VFP.ActiveForm.ActiveControl IF LOWER(edt.BaseClass) = editbox edt.Value = SUBSTR(edt.Value, 1, edt.SelStart) + DTOC(DATE()) + SUBSTR(edt.Value, edt.SelStart) edt.SelStart = edt.SelStart + len(dtoc(date())) ENDIF Tracy Pearson PowerChurch Software

Re: Inserting a date

2014-03-25 Thread Fred Taylor
are processed. Fred On Tue, Mar 25, 2014 at 2:31 PM, Gérard Lochon g-loc...@wanadoo.fr wrote: - Original Message - From: Jean MAURICE jsm.maur...@wanadoo.fr To: profox@leafe.com Sent: Tuesday, March 25, 2014 9:26 PM Subject: Re: Inserting a date That's right ! I did not think