Hello frieds,
I see this string in FWLOG.
cVData = E "button <br> \ r \ n reset <br> \ r \ n submit
I think it's a UNIX format. How can you convert this string to DOS?
As a workaround I am writing to the FWLOG file and then read the data from there. But I am sure there is a better way.
Is there a conversation function.
Best regards,
Otto
unix2dos
- Otto
- Posts: 6403
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 24 times
- Been thanked: 2 times
- Contact:
unix2dos
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Otto
- Posts: 6403
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 24 times
- Been thanked: 2 times
- Contact:
Re: unix2dos
Hello,
I forgot to post my workaround,
a funny one but working.
Best regards,
Otto
I forgot to post my workaround,
a funny one but working.
Best regards,
Otto
Code: Select all | Expand
fwlog cLine
cDosLine := unix2dos()
function unix2dos
local chtmlfile
local nAt := 0
local cTmp := ""
chtmlfile :=memoread( "readhtm.log" )
ferase("readhtm.log")
chtmlfile := STRTRAN( chtmlfile, '\r\n' , '' )
chtmlfile := STRTRAN( chtmlfile, 'E"' , ' "' )
memowrit("readhtm.txt",chtmlfile)
cTmp := memoread( "readhtm.txt" )
nAt := AT( '"', cTmp )
cTmp := substr(cTmp , nAt+1 )
cTmp := ALLTRIM( left( cTmp, (len(cTmp)-4 ) ) )
return( cTmp )
//----------------------------------------------------------------------------//
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
Re: unix2dos
My function is
Code: Select all | Expand
FUNCTION Unix2Win( cArqu )
LOCAL cBuff := ""
LOCAL cSaid := "DoUnix.txt"
LOCAL nEntr
LOCAL nSaid
LOCAL lRetu := .T.
BEGIN SEQUENCE
IF ( nEntr:= fOpen( cArqu ) ) < 1
msgStop( "IMPOSSÍVEL ABRIR: " + cArqu, msg_atencao )
lRetu := .F.
BREAK
ENDIF
IF (nSaid:= fCreate( cSaid ) ) < 1
msgStop( "IMPOSSÍVEL CRIAR: " + cSaid, msg_atencao )
lRetu := .F.
fClose( nEntr )
BREAK
ENDIF
WHILE hb_fReadLine( nEntr, @cBuff, chr(10) ) == 0
fWrite( nSaid, cBuff + hb_OSNewLine() )
ENDDO
IF len( cBuff ) > 0
fWrite( nSaid, cBuff + hb_OSNewLIne() )
ENDIF
fClose( nSaid )
fClose( nEntr )
END SEQUENCE
RETURN ( lRetu )
Regards,
André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
- Antonio Linares
- Site Admin
- Posts: 42516
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 75 times
- Contact:
Re: unix2dos
Dear Otto,
\ r \ n is Chr( 13 ) + Chr( 10 ), in FWH we have a define for it: CRLF
<br> is html code, and it seems so for button and submit
how do you create such line ?![Smile :-)](./images/smilies/icon_smile.gif)
\ r \ n is Chr( 13 ) + Chr( 10 ), in FWH we have a define for it: CRLF
<br> is html code, and it seems so for button and submit
how do you create such line ?
![Smile :-)](./images/smilies/icon_smile.gif)
- Otto
- Posts: 6403
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 24 times
- Been thanked: 2 times
- Contact:
Re: unix2dos
Dear Antonio,
Many thanks for your response. I read the attributes and event attributes of all tags from W3Schools.com. Some attributes then return these strings.
You can only see in FWLOG that E "and \ r \ n are still there.
I can't see the E "either when I scan the characters one by one.
The workaround works, and I now have the entire TAGLIST in a DBF file.
Best regards,
Otto
![Image](https://mybergland.com/auoptcode/dbftagliste.jpg)
![Image](https://mybergland.com/auoptcode/Clip1.jpg)
![Image](https://mybergland.com/auoptcode/Clip2.jpg)
![Image](https://mybergland.com/auoptcode/Clip3.jpg)
![Image](https://mybergland.com/auoptcode/Clip4.jpg)
Many thanks for your response. I read the attributes and event attributes of all tags from W3Schools.com. Some attributes then return these strings.
You can only see in FWLOG that E "and \ r \ n are still there.
I can't see the E "either when I scan the characters one by one.
The workaround works, and I now have the entire TAGLIST in a DBF file.
Best regards,
Otto
![Image](https://mybergland.com/auoptcode/dbftagliste.jpg)
![Image](https://mybergland.com/auoptcode/Clip1.jpg)
![Image](https://mybergland.com/auoptcode/Clip2.jpg)
![Image](https://mybergland.com/auoptcode/Clip3.jpg)
![Image](https://mybergland.com/auoptcode/Clip4.jpg)
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************