FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour GET COPY/PASTE and crlf
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
GET COPY/PASTE and crlf
Posted: Wed Nov 02, 2011 01:54 PM
Hi,
If a select the text in oGet1 and press CTRL_C
Then I move in the second get oGet2
And Press CTRL_V
I find only "Marco "

Any hints?

marco


Code (fw): Select all Collapse
#include "fivewin.ch"

#define crlf CHR(13)+CHR(10)


FUNCTION main()
   local oDlg
   local oGet1  , cGet1  := "Marco " + crlf + "Boschi     "
   local oGet2  , cGet2  := "Enrico Maria Giordano        "
   define dialog oDlg

   @ 1,1 get oGet1 var cGet1 of oDlg

   @ 2,1 get oGet2 var cGet2 of oDlg

   ACTIVATE DIALOG oDlg CENTER

return nil
Marco Boschi
info@marcoboschi.it
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: GET COPY/PASTE and crlf
Posted: Wed Nov 02, 2011 02:42 PM

Try making both of the GETs multiline.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: GET COPY/PASTE and crlf
Posted: Wed Nov 02, 2011 03:14 PM

James,
it works!
But I need single line get objects.
The problem is to allow paste text after removing crlf.

marco

Marco Boschi
info@marcoboschi.it
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: GET COPY/PASTE and crlf
Posted: Wed Nov 02, 2011 04:18 PM

Note that a "multiline" Get can actually be only one line high. "Multiline" is a property not a dimension (in this case).

Please explain why you would have a CRLF in a Get that is only one line high, and in more detail what you are trying to do.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: GET COPY/PASTE and crlf
Posted: Wed Nov 02, 2011 05:29 PM

James,
I have several gets for free notes.
Sometimes user copy from web pages text in one or more lines and paste it into a single line get.

If the solution is to use in these gets "multiline" property how have I to define them?

Many thanks

marco

FUNCTION main()
local oDlg
local oGet1 , cGet1 := "Marco "
local oGet2 , cGet2 := "Enrico Maria Giordano "
define dialog oDlg

@ 1,1 get oGet1 var cGet1 of oDlg

@ 2,1 get oGet2 var cGet2 of oDlg

ACTIVATE DIALOG oDlg CENTER

return nil

Marco Boschi
info@marcoboschi.it
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: GET COPY/PASTE and crlf
Posted: Wed Nov 02, 2011 07:28 PM

Your sample works fine here using FWH 11.09.

EMG

Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: GET COPY/PASTE and crlf
Posted: Wed Nov 02, 2011 09:07 PM

EMG,
did you test the first sample?
The one containing crlf in the first get?
King regards
marco

Marco Boschi
info@marcoboschi.it
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: GET COPY/PASTE and crlf
Posted: Wed Nov 02, 2011 09:53 PM
Marco,

The first problem is that the field length for the second field wasn't long enough so the data was getting truncated and it appeared that the CRLF was causing it. Try this:

Code (fw): Select all Collapse
#include "fivewin.ch"

FUNCTION main()
   local oDlg
   local oGet1  , cGet1  := "Marco " + CRLF + "Boschi     "
   local oGet2  , cGet2  := "Enrico Maria Giordano                  " // longer

   define dialog oDlg

   @ 1,1 get oGet1 var cGet1 of oDlg

   @ 2,1 get oGet2 var cGet2 of oDlg

    ACTIVATE DIALOG oDlg CENTER

return nil

Now with the longer field you can use bChange to strip out the CRLF's:

Code (fw): Select all Collapse
#include "fivewin.ch"

FUNCTION main()
   local oDlg
   local oGet1  , cGet1  := "Marco " + CRLF + "Boschi     "
   local oGet2  , cGet2  := "Enrico Maria Giordano                  "

   define dialog oDlg

   @ 1,1 get oGet1 var cGet1 of oDlg

   @ 2,1 get oGet2 var cGet2 of oDlg

    oGet2:bChange := {|,,o| o:oGet:buffer := strtran(o:oGet:buffer,CRLF,"") }

   ACTIVATE DIALOG oDlg CENTER

return nil


Regards,
James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: GET COPY/PASTE and crlf
Posted: Wed Nov 02, 2011 10:30 PM
MarcoBoschi wrote:EMG,
did you test the first sample?
The one containing crlf in the first get?


Yes.

EMG
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: GET COPY/PASTE and crlf
Posted: Thu Nov 03, 2011 08:38 AM

James,
I've compiled your last posted code
I have this error
Probably I'm using a too old version of fwh
Many thanks

marco
this is the error

Application

Path and name: C:\gc\james.exe (32 bits)
Size: 1,902,592 bytes
Time from start: 0 hours 0 mins 10 secs
Error occurred at: 11/03/11, 09:37:00
Error description: Error BASE/1126 Argument error: STRTRAN
Args:
[ 1] = U
[ 2] = C

 [   3] = C

Stack Calls

Called from: => STRTRAN(0)
Called from: james.prg => (b)MAIN(16)
Called from: tget.prg => TGET:KEYCHAR(1091)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: control.prg => TCONTROL:HANDLEEVENT(1469)
Called from: tget.prg => TGET:HANDLEEVENT(586)
Called from: .\source\classes\WINDOW.PRG => _FWH(3347)
Called from: => DIALOGBOXINDIRECT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
Called from: james.prg => MAIN(18)

Marco Boschi
info@marcoboschi.it
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: GET COPY/PASTE and crlf
Posted: Thu Nov 03, 2011 08:39 AM

To EMG,
Please could you send me this little sample compiled with new version?
I have to verify how many little problems are solved.

Thank you

include "fivewin.ch"

define crlf CHR(13)+CHR(10)

FUNCTION main()
local oDlg
local oGet1 , cGet1 := "Marco Boschi "
local oGet2 , cGet2 := "Enrico Maria Giordano "

define dialog oDlg

@ 1,1 get oGet1 var cGet1 of oDlg

@ 2,1 get oGet2 var cGet2 of oDlg

ACTIVATE DIALOG oDlg CENTER

return nil

Marco Boschi
info@marcoboschi.it
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: GET COPY/PASTE and crlf
Posted: Thu Nov 03, 2011 09:28 AM

Please note that this second sample doesn't use CRLF. Do you want me to compile this new version or the first version that started this topic?

EMG

Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: GET COPY/PASTE and crlf
Posted: Thu Nov 03, 2011 09:34 AM

It's the same
thanks

Marco Boschi
info@marcoboschi.it
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: GET COPY/PASTE and crlf
Posted: Thu Nov 03, 2011 12:45 PM

Thanks

marco

Marco Boschi
info@marcoboschi.it