RTF File export

Klaus Major klaus at major-k.de
Tue Oct 19 06:20:10 EDT 2004


Bon jour François,

> Hello everybody!
>
> I want to export a fld (pourexport) into an RTF file (to save the  
> style and the font)
>
> I have this code
>
>  put cheminresultat &fichieràcréer into fichierexport
>  open file fichierexport for text update
>  write THE RTFTEXT OF FLD "POUREXPORT" of card 2 of stack"cukydata" to 
> file fichierexport at "EOF"
> close file fichierexport
>
> And my file is always TXT file.
>
> Why please?

I suppose you are working on a mac? Right :-)

If you write something to a file the resulting file will always have 
TEXT as the -> filetype,
UNLESS you set the filetype BEFORE you are writing that file...

Please remember, ONLY the filetype is TEXT, but the content of the file 
is actually RTF-code!

Read: the file only LOOKS liek a text-file to the finder!
But we developers cannot be fooled this easy ;-)

As long as noone tries to DOUBLECLICK the file in the finder, no need 
to worry :-)

> Thank you for your answer.
>
> Friendly
> François

Au revoir, mon ami...

Klaus Major
klaus at major-k.de
http://www.major-k.de



More information about the use-livecode mailing list