FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Possible to make CRLF of multiline gets visible ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Possible to make CRLF of multiline gets visible ?

Posted: Tue Jun 07, 2016 04:53 PM
Hello,

is it possible to make the CRLF's of MULTILINE gets visible ?
Because I need structured gets for printing, I'm looking for a solution the user can
control the linefeeds. Maybe a color or < for the end of line.



best regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM

Re: Possible to make CRLF of multiline gets visible ?

Posted: Wed Jun 08, 2016 04:42 AM
What about using StrReplace(YourText,CRLF, "<LineFeed>") before displaying the content to the user and convert back to StrReplace(YourText, "<LineFeed>", CRLF) before saving to file

Just an idea.

Regards
Anser
Posts: 1283
Joined: Fri Feb 10, 2006 02:34 PM

Re: Possible to make CRLF of multiline gets visible ?

Posted: Wed Jun 08, 2016 05:44 AM

Hi,

StrReplace(YourText,CRLF, "<LineFeed>" + CRLF )

Salutacions, saludos, regards

"...programar es fácil, hacer programas es difícil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
HIX -> https://github.com/carles9000/hix
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Re: Possible to make CRLF of multiline gets visible ?

Posted: Wed Jun 08, 2016 12:15 PM
Thank You very much for the info

my working solution :



Reading the multiline GET

aDat[90] := STRTRAN(("PATIENT")->MEDIKAM1, CRLF, "|")
aDat[91] := STRTRAN(("PATIENT")->MEDIKAM2, CRLF, "|")


Edit

REDEFINE GET oDat[90] VAR aDat[90] ID 610 ;
OF oFld:aDialogs[ 1 ] FONT oFontsys MULTILINE UPDATE
REDEFINE GET oDat[91] VAR aDat[91] ID 620 ;
OF oFld:aDialogs[ 1 ] FONT oFontsys MULTILINE UPDATE


saving the multiline GET
( force a CRLF at the end )

LOCAL cMedik1 := STRTRAN(aDat[90], "|", CRLF )
LOCAL cMedik2 := STRTRAN(aDat[91], "|", CRLF )
....
....
a missing CRLF at the end :

IF SUBSTR( aDat[90], LEN( TRIM( aDat[90] ) ) - 1, 1 ) <> CRLF
cMedik1 := TRIM( STRTRAN(aDat[90], "|", CRLF ) ) + CRLF
ELSEIF SUBSTR( aDat[91], LEN( TRIM( aDat[91] ) ) - 1, 1 ) <> CRLF
cMedik2 := TRIM( STRTRAN(aDat[91], "|", CRLF ) ) + CRLF
ENDIF
("PATIENT")->MEDIKAM1 := cMedik1
("PATIENT")->MEDIKAM2 := cMedik2


regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM

Re: Possible to make CRLF of multiline gets visible ?

Posted: Thu Jun 09, 2016 02:47 PM

Uwe,

In your resource editor have you checked both "Want Return" and "Multiline" for these fields? If you do this, then I don't think you need to do anything else--it will work like a wordprocessor so the user can see where the line ends.

In your code it looks like you are checking one character to see if it is CRLF, but CRLF is two characters.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Re: Possible to make CRLF of multiline gets visible ?

Posted: Thu Jun 09, 2016 05:22 PM
James,

thank You

Yes it is the way I'm doing it.
There is only one situation : the user keeps on writing
and gets a auto-linebreak because of the get-width.
At the end, there is just one line, like the section of the printpreview shows.
But I think to cover every possible situaton is to much work.



best regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM

Re: Possible to make CRLF of multiline gets visible ?

Posted: Thu Jun 09, 2016 06:13 PM

Ewe,

I'm not sure I understand exactly what you are trying to accomplish.

If you are just concerned with the printer output, couldn't you just wordwrap the lines during printing?

I may have some old code to help with that, if that is what you need.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion