Hi all
If I run the following code
= Adbobjects(laTables, 'Table') = Asort(laTables) _Cliptext = "" * The array has 365 rows For lnTable = 1 To Alen(laTables) Use (Right(Juststem(loData),1) + "_" + laTables(lnTable)) _Cliptext = _Cliptext + Padr(laTables(lnTable),20) + Replicate(Chr(9),2) + Str(Reccount(),10,0) + Chr(13) Endfor ? MemLines(_Cliptext) * _Cliptext only has 357 lines
But if I use a variable lcCliptext instead of _Cliptext all is well (lcCliptext has 365 lines). It is as if _Cliptext can't keep up ...
Paul Newton
_cliptext is a pointer to the textpart of the Windows clipboard (which also has other representations available, like rtf or unicode). Thus if you mess mith _cliptext in a loop, you're triggering some background tasks. It's better to use a local var for aggregating and then as a final step assign it to _cliptext.
wOOdy
That's what I found out ... thanks for the explanation/clarification wOOdy
Paul
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Jürgen Wondzinski Sent: 07 December 2017 11:23 To: profoxtech@leafe.com Subject: AW: Issue with _cliptext
_cliptext is a pointer to the textpart of the Windows clipboard (which also has other representations available, like rtf or unicode). Thus if you mess mith _cliptext in a loop, you're triggering some background tasks. It's better to use a local var for aggregating and then as a final step assign it to _cliptext.
wOOdy
[excessive quoting removed by server]
Funnily enough we also had an issue with the clipboard earlier in the week when using DataToClip().
When using date fields or datetime fields in the cursor, running DataToCLip(<cursor>, <Option>) whether Option is set to 1 or 3 (Space delimited or tab delimited) and then pasting the clipboard into Excel, dates really do screw up as some dates go in British style DD/MM/YY and other dates get pasted in the American format MM/DD/YY regardless of the display format selected.
Solution: In the cursor you are copying into the clipboard, send " "+dtoc(<datefield>) as opposed to the datefield. Note that just using dtoc(<datefield>) produces exactly the same results as sending a date field. All date fields then go into the spreadsheet as proper "Date" values and are displayed correctly.
Just a heads up in case anyone else is pasting into Excel.
Dave
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Paul Newton Sent: 07 December 2017 10:44 To: profoxtech@leafe.com Subject: Issue with _cliptext
Hi all
If I run the following code
= Adbobjects(laTables, 'Table') = Asort(laTables) _Cliptext = "" * The array has 365 rows For lnTable = 1 To Alen(laTables) Use (Right(Juststem(loData),1) + "_" + laTables(lnTable)) _Cliptext = _Cliptext + Padr(laTables(lnTable),20) + Replicate(Chr(9),2) + Str(Reccount(),10,0) + Chr(13) Endfor ? MemLines(_Cliptext) * _Cliptext only has 357 lines
But if I use a variable lcCliptext instead of _Cliptext all is well (lcCliptext has 365 lines). It is as if _Cliptext can't keep up ...
Paul Newton
[excessive quoting removed by server]
Dave,
For _VFP.DataToClip() aren't the options the third parameter? Your code shows it as the second parameter.
ApplicationObject.DataToClip([nWorkArea | cTableAlias] [, nRecords] [, nClipFormat])
Fred
On Thu, Dec 7, 2017 at 6:22 AM, Dave Crozier DaveC@flexipol.co.uk wrote:
Funnily enough we also had an issue with the clipboard earlier in the week when using DataToClip().
When using date fields or datetime fields in the cursor, running DataToCLip(<cursor>, <Option>) whether Option is set to 1 or 3 (Space delimited or tab delimited) and then pasting the clipboard into Excel, dates really do screw up as some dates go in British style DD/MM/YY and other dates get pasted in the American format MM/DD/YY regardless of the display format selected.
Solution: In the cursor you are copying into the clipboard, send " "+dtoc(<datefield>) as opposed to the datefield. Note that just using dtoc(<datefield>) produces exactly the same results as sending a date field. All date fields then go into the spreadsheet as proper "Date" values and are displayed correctly.
Just a heads up in case anyone else is pasting into Excel.
Dave
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Paul Newton Sent: 07 December 2017 10:44 To: profoxtech@leafe.com Subject: Issue with _cliptext
Hi all
If I run the following code
= Adbobjects(laTables, 'Table') = Asort(laTables) _Cliptext = ""
- The array has 365 rows
For lnTable = 1 To Alen(laTables) Use (Right(Juststem(loData),1) + "_" + laTables(lnTable)) _Cliptext = _Cliptext + Padr(laTables(lnTable),20) + Replicate(Chr(9),2) + Str(Reccount(),10,0) + Chr(13) Endfor ? MemLines(_Cliptext)
- _Cliptext only has 357 lines
But if I use a variable lcCliptext instead of _Cliptext all is well (lcCliptext has 365 lines). It is as if _Cliptext can't keep up ...
Paul Newton
[excessive quoting removed by server]
Correct... my bad!
Dave
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Fred Taylor Sent: 07 December 2017 15:51 To: ProFox Email List profox@leafe.com Subject: Re: Issue with _cliptext
Dave,
For _VFP.DataToClip() aren't the options the third parameter? Your code shows it as the second parameter.
ApplicationObject.DataToClip([nWorkArea | cTableAlias] [, nRecords] [, nClipFormat])
Fred
On Thu, Dec 7, 2017 at 6:22 AM, Dave Crozier DaveC@flexipol.co.uk wrote:
Funnily enough we also had an issue with the clipboard earlier in the week when using DataToClip().
When using date fields or datetime fields in the cursor, running DataToCLip(<cursor>, <Option>) whether Option is set to 1 or 3 (Space delimited or tab delimited) and then pasting the clipboard into Excel, dates really do screw up as some dates go in British style DD/MM/YY and other dates get pasted in the American format MM/DD/YY regardless of the display format selected.
Solution: In the cursor you are copying into the clipboard, send " "+dtoc(<datefield>) as opposed to the datefield. Note that just using dtoc(<datefield>) produces exactly the same results as sending a date field. All date fields then go into the spreadsheet as proper "Date" values and are displayed correctly.
Just a heads up in case anyone else is pasting into Excel.
Dave
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Paul Newton Sent: 07 December 2017 10:44 To: profoxtech@leafe.com Subject: Issue with _cliptext
Hi all
If I run the following code
= Adbobjects(laTables, 'Table') = Asort(laTables) _Cliptext = ""
- The array has 365 rows
For lnTable = 1 To Alen(laTables) Use (Right(Juststem(loData),1) + "_" + laTables(lnTable)) _Cliptext = _Cliptext + Padr(laTables(lnTable),20) + Replicate(Chr(9),2) + Str(Reccount(),10,0) + Chr(13) Endfor ? MemLines(_Cliptext)
- _Cliptext only has 357 lines
But if I use a variable lcCliptext instead of _Cliptext all is well (lcCliptext has 365 lines). It is as if _Cliptext can't keep up ...
Paul Newton
[excessive quoting removed by server]