Hi Pritpal Bedi,
Ok, thank you for explanation. I thought that was compatible xharbour with
Harbour and Harbour with xHarbour.
Solved the problem by modifying the function Open_Word, leaving as below:

*****************************
Function Open_word( cArquivo )
*****************************
local cArqRtf, arq , cHandle
local cCaractere  := space( 01 )
local cLinha      := space( 01 )
local lf          := chr( 13 ) + chr( 10 )

cArqRtf  := lower( left( cArquivo, len( cArquivo ) - 4 ) + ".doc" )
arq      := fcreate( cArqRtf, 1 )
cHandle  :=
"{\rtf1\ansi\ansicpg1252\deff0\deflang1046{\fonttbl{\f0\fmodern\fprq1\fcharset0
Courier New;}{\f1\fswiss\fcharset0 Arial;}}" + lf
cHandle  += "\margl284\margr505\margt505\margb505" + lf

cHandle  += "{\*\generator Msftedit
5.41.15.1503;}\viewkind4\uc1\pard\f0\fs14 "
fwrite( arq, cHandle )

cText := memoread( cArquivo )
for nA := 1 to mlcount( cText, 150 )
  cCaractere := memoline( cText, 150, nA, 1, .F. )
  cCaractere  += "\par" + lf
  fwrite( arq, cCaractere )
NEXT
cHandle  := "}"
fwrite( arq, cHandle )
fclose( arq          )

*Open_arquivo( cArqRtf )
Return( .T. )
***************

Leonardo Machado



Pritpal Bedi wrote:
> 
> Hi
> 
> 
> sygecom wrote:
>> 
>> First of sorry for the post, but I'm moving to Harbour, I'm full of
>> questions to resolve.
>> Below is another example that compiling and running without problems in
>> xHarbour, but when you try to run with harbor it generates an error on
>> the line 'if asc (cCaractere) == chr (13)'
>> 
> 
> Everybody is welcome. Group will be more than glad to respond you.
> 
> asc( cCharacter ) == chr( 13 )
> 
> Does not it looks weired. 
> How you can compare NUMERIC with CHARCATER?
> You could have compared it as : cCharacter == chr( 13 ).
> Did you check it with Clipper ?
> 
> NOTE: In xHarbour ONE character string is treated as a number 
> so you were able to compare as above. I know that in C it works like
> it is implemented in xHarbour but we are accustomed to the language
> CLIPPER. 
> 
> Now I know that in one of projects under my supervision blow up randomely
> and error log always report that comparison operands are not of same 
> type. 
> 
> Hope you may be clear now.
> 
> BTW there is some compiler switch in Harbour which mimmics this behaviour.
> correct and complete me if right ...
> 
> Regards
> Pritpal Bedi
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Error-in-function-to-create-the-Word-file-tp23046678p23048125.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to