Possible to make CRLF of multiline gets visible ?

Possible to make CRLF of multiline gets visible ?

Postby ukoenig » Tue Jun 07, 2016 4: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.

Image

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Possible to make CRLF of multiline gets visible ?

Postby anserkk » Wed Jun 08, 2016 4: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
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Possible to make CRLF of multiline gets visible ?

Postby Carles » Wed Jun 08, 2016 5: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
Skype -> https://join.skype.com/cnzQg3Kr1dnk
User avatar
Carles
 
Posts: 1135
Joined: Fri Feb 10, 2006 2:34 pm
Location: Barcelona

Re: Possible to make CRLF of multiline gets visible ?

Postby ukoenig » Wed Jun 08, 2016 12:15 pm

Thank You very much for the info

my working solution :

Image

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 :D
Last edited by ukoenig on Thu Jun 09, 2016 5:22 pm, edited 2 times in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Possible to make CRLF of multiline gets visible ?

Postby James Bott » Thu Jun 09, 2016 2: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Possible to make CRLF of multiline gets visible ?

Postby ukoenig » Thu Jun 09, 2016 5: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.

Image

best regards
Uwe :D
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Possible to make CRLF of multiline gets visible ?

Postby James Bott » Thu Jun 09, 2016 6: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 97 guests