Quill to RTF Super BASIC convertor - doc2rtf_bas

Anything QL Software or Programming Related.
Post Reply
tcat
Super Gold Card
Posts: 633
Joined: Fri Jan 18, 2013 5:27 pm
Location: Prague, Czech Republic

Quill to RTF Super BASIC convertor - doc2rtf_bas

Post by tcat »

Hi,

I found this handy tool, also available at Dilwyn's site.
It is pure Super BASIC coded by Mark J Swift, and runs on unexpanded systems.
It requires TURBO Toolkit.

I had to change the following lines to make it run under the current Turbo Toolkit version v3.43, as STRINGL keyword is undefined, while LOGINTEGER seems a suitable replacement for it, correct?

Code: Select all

tcat@lynx:~/ql/sw/doc2rtf$ diff DOC2RTF.bas doc2rtf_bas
89c89
< 1630  tblOffs=STRINGL(INPUT$(#6,4))
---
> 1630  tblOffs=LONGINTEGER(INPUT$(#6,4))
146c146
< 1817  txtOffs=STRINGL(INPUT$(#6,4))
---
> 1817  txtOffs=LONGINTEGER(INPUT$(#6,4))
155c155
< 1826  txtOffs=STRINGL(INPUT$(#6,4))
---
> 1826  txtOffs=LONGINTEGER(INPUT$(#6,4))
196c196
< 1869  txtOffs=STRINGL(INPUT$(#6,4))
---
> 1869  txtOffs=LONGINTEGER(INPUT$(#6,4))
I ran the convertor on FUNFONTS_DOC article by Dilwyn, good news, I am getting an RTF output, but it has got some paragraph numbers at left hand and down the side. Pictures are referred with externally e.g.
$$$fonts1.gif Character definition 5x9 grid$$$
Cannot display these in Abiword nor LibreOffice Writer.
DOC2RTF_BAS in action
DOC2RTF_BAS in action
doc2rtf.png (5 KiB) Viewed 3157 times
I may try recompiling it with current TURBO compiler version.
FUNFONTS_RTF output file
FUNFONTS_RTF output file
Tom


swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: Quill to RTF Super BASIC convertor - doc2rtf_bas

Post by swensont »

I'll take it that you are looking for suggestion on resolving the issues, so here is my try:

1. Start off with some really simple Quill documents. Maybe one line of text, a line of bold, a line of underline, etc. Run that through the tool and see how it looks.

2. Review the raw RTF document and see where the problems might be. I believe the RTF format should be published somewhere. See if the tool is producing valid a valid RTF document.

If you hit a wall, ask others to assist. Send the code to volunteers and they might be able to fix any remaining glitches (or find the glitches).

There has been some discussion of moving QL documents directly to PDF. I would prefer to move to a word processing format (either MS Word .doc or OpenOffice/LibreOffice .odt) and then move the PDF. This would make it easier to edit the documents for updates.


User avatar
tofro
Font of All Knowledge
Posts: 2703
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Quill to RTF Super BASIC convertor - doc2rtf_bas

Post by tofro »

swensont wrote:... I believe the RTF format should be published somewhere.
I believe as well:
http://www.biblioscape.com/rtf15_spec.htm

Regards,
Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
tcat
Super Gold Card
Posts: 633
Joined: Fri Jan 18, 2013 5:27 pm
Location: Prague, Czech Republic

Re: Quill to RTF Super BASIC convertor - doc2rtf_bas

Post by tcat »

Toby, SwenSont,

Thanks for the RTF reference link, I found what is confusing LibreOffice Writer, these TWO directives, they appear in the output only once as part of the header,

\linemod0 \linex0

the header code follows

Code: Select all

{\rtf0 \ansi

{\fonttbl
{\f22 \fmodern Courier;}
}

{\stylesheet
{\s243 \qc \f22 \fs20 \sbasedon0 \snext243 footer;}
{\s244 \qc \f22 \fs20 \sbasedon0 \snext244 header;}
{\f22 \fs20 \sbasedon222 \snext0 Normal;}
}

\paperw11880 \paperh16800 \deftab606
\margl1080 \margr1102 \margt-1200 \margb-1200
\widowctrl \ftnbj \pgnstart1 \fracwidth 
\sectd \linemod0 \linex0 \headery1200 \footery1200 \cols1 \endnhere
\plain \f22 \fs20
They are meant for line numering, while zero values may switch the numbering off, the Writer numbers every 5th line, and restarts sequence 5,10,15,20... on every page.

If directives \linemod0 \linex0 removed completely, numbering then disappears in the Writer, while it does not confuse all other editors I have tested, except MS*Word that I do not have and cannot test.

So I believe, nothing wrong with convertor, and I will be sharing the updated and compiled code shorlty.

HOW ABOUT Turbo Tookit? Can anyone help?
I believe over the years and subsequent new versions,
STRINGL keyword has gone and was replaced by LONGINTEGER, could it be so?

Many thanks
Tom


User avatar
tofro
Font of All Knowledge
Posts: 2703
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Quill to RTF Super BASIC convertor - doc2rtf_bas

Post by tofro »

Tom,

Did a quick check: STRINGL doesn't show up in any of the SuperBASIC keyword lists that I have (and I have some....), and also not in Rich Mellor's SuperBASIC reference manual.
Although it appears to sound more like picking the length of the string (which wouldn't make a lot of sense), I would suppose the LONGINTEGER replacement you chose was OK (Especially as the program appears to work...).

Regards,
Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
tcat
Super Gold Card
Posts: 633
Joined: Fri Jan 18, 2013 5:27 pm
Location: Prague, Czech Republic

Re: Quill to RTF Super BASIC convertor - doc2rtf_bas

Post by tcat »

Hi,

Just to let you know, updated package including sources now available for download in "File transfer" section.

Tom


Post Reply