Txt2Bas related question?

Everything related to BASIC version 1.x (Oric 1 and Atmos) or HYPERBASIC (Telestrat).
Don't hesitate to give your small program samples, technical insights, or questions...
Post Reply
Brana
Flying Officer
Posts: 156
Joined: Fri Nov 30, 2007 8:30 pm
Contact:

Txt2Bas related question?

Post by Brana » Thu Jun 28, 2018 2:46 pm

Hello. I know there is an awesome EXE file txt2bas which enables me to convert plain txt to a Tap file.

But that's all it actually do;
It literaly converts any txt to a tap file.
Does not add line numbers, does not add nothing...

If (previously) in the source file was not added, for example:

10 DATA "...
(at the beginning of every line of the imported text)

Then - that text would result just in the
Syntax error
in a such created Tap file.

I am looking in the possibility of importing books, or other kind of reading material - in to the Euphoric emulator.

So - just an idea / question?
Is there an (allready - maybe) the easy way to do THAT?

For example - the utility similar to the allready existing txt2bas.exe.

But with the added features like the:
- Adding short viewer program at the beginning of the imported text so that the Euphoric can actually show and scroll trough the imported Text,
- Imported text maybe to be imported in DATA, or String (or some other, similar) format,
- To support maybe a simple Text Search (from within the TAP file created).


Yes I know Euphoric can handle only up to the about 40kb of DATA.
Approximatly 20 Word pages.
But, using it on Android - it IS easier (and - for me more apriciated) to read something - in my "own native" enviorment :D rather than using for example Microsoft product :D

For this purpose I at least use Excell on computer to:
- Add number rows for Euphoric, like:
1
2
3
4
5
and so on,

- Add DATA or WRD(N)$=" Rows, so it looks like:
1 DATA
or
1 WRD$(1)="...

- then add the row of text, splitted at the lines no larger than 25 characters...

- And then i convert that Excell workbook to a plain text,
- And then I use txt2bas.exe to convert that in to a tap file to have my "book" readable on Euphoric.

And this process can be a pain...
So.. maybe... Is there an easier way? :)

User avatar
Chema
Game master
Posts: 2247
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Txt2Bas related question?

Post by Chema » Fri Jun 29, 2018 10:59 pm

I don't think such a tools exists. It is certainly possible to do what you want, but I've never heard of a program that does that.

Maybe something not Oric related that creates a BASIC source?

User avatar
Dbug
Site Admin
Posts: 2618
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Txt2Bas related question?

Post by Dbug » Sat Jun 30, 2018 9:37 am

Well, there are two different things to consider with your issue:
- The actual storage of things in the ORIC
- How to display them

It would technically possible to convert anything into DATA lines, with line numbers, etc... (it's actually what Bin2Txt does, see http://osdk.org/index.php?page=document ... ge=bin2txt ) but the problem is that this is incredibly wasteful.

What you could do instead, is to just used HEADER.EXE to convert your file into a TAP file that loads as binary to a specific address, this way you don't waste any room at all and you can store any file that fits in the memory limit without even thinking about how much space is wasted with line numbers, etc...

The on the side you can do a viewer program that can read the memory location where you loaded the other data and display it on screen. You could even have different viewers for different format of files.

If you make it a DISK based program, using SEDORIC 3, you even have access to all these fancy new commands like "move" that can copy directly stuff from memory to the screen to avoid slow PEEK and POKE.

Brana
Flying Officer
Posts: 156
Joined: Fri Nov 30, 2007 8:30 pm
Contact:

Re: Txt2Bas related question?

Post by Brana » Tue Jul 03, 2018 4:40 am

Hmmm... I am not so sure that I could manage that... :(

On the other hand, I had the following idea:

By using this little utility at the url:
http://www.softpedia.com/get/Desktop-En ... ouse.shtml

And by using Euphoric with this little piece of Basic program that I just wrote:

Code: Select all

 1 PRINT"Turn ON the Virutal Printer or press ESC"
 2 GETA$:IFA$=""THEN2
 3 IFASC(A$)=27THENCLOAD"MENU.TAP"
 4 '
 5 FORA=100TO500
 6 A$=STR$(A)
 7 A$=RIGHT$(A$,3)
 8 FORS=1TO3
 9 N$=MID$(A$,S,1)
 10 GOSUB1000
 11 NEXTS
 12 N$="SPACE":GOSUB1000
 13 N$="D":GOSUB1000
 14 N$="A":GOSUB1000
 15 N$="T":GOSUB1000
 16 N$="A":GOSUB1000
 17 N$="SPACE":GOSUB1000
 18 FORS=1TO38
 19 N$="RIGHT":GOSUB1000
 20 NEXT S
 21 N$="ENTER":GOSUB1000
 22 PRINTA:NEXTA
 23 STOP
 1000 LPRINT "{"+N$+" down}"
 1001 LPRINT "{Delay 0.20}"
 1002 LPRINT "{"+N$+" up}"
 1003 LPRINT "{Delay 0.20}"
 1004 RETURN
 63999 CSAVE"VMOUSE.TAP",AUTO:WAIT99:CLOAD"VMOUSE.TAP",V

In the Printer.OUT file created by the Euphoric I get the following:

Code: Select all

{1 down}
{Delay 0.20}
{1 up}
{Delay 0.20}
{0 down}
{Delay 0.20}
{0 up}
{Delay 0.20}
{0 down}
{Delay 0.20}
{0 up}
{Delay 0.20}
{SPACE down}
{Delay 0.20}
{SPACE up}
{Delay 0.20}
{D down}
{Delay 0.20}
{D up}
{Delay 0.20}
{A down}
{Delay 0.20}
{A up}
{Delay 0.20}
{T down}
{Delay 0.20}
{T up}
{Delay 0.20}
{A down}
{Delay 0.20}
{A up}
{Delay 0.20}
{SPACE down}
{Delay 0.20}
{SPACE up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
{RIGHT up}
{Delay 0.20}
{RIGHT down}
{Delay 0.20}
....and so on...
And then I just rename the Printer.Out file (created with the Euphoric!!!) in to the GhostMouse.rms file,
Then I right-click it, to open RMS file with GhostMouse,
Then I open the desired TXT file that I want to convert (in Notepad, Wordpad, or Word - whatever - any will work),
Then Press F9 to start Ghost Mouse to run on that text with THIS (In Euphoric created) RMS script (!)

AND IT CONVERTS ANY TXT, in any textual editor - in to Basic acceptable format, that is - in to the following format:

100 DATA (text--38 letters per a row) (enter)
101 DATA (text--38 letters per a row) (enter)
...
up to 500 lines (experimental -- for now).

After that -- I just run txt2bas to create the TAP file for the Euphoric. :D

BUT IT JUST WORKS! :) :) :) :) :) :)

User avatar
iss
Squad Leader
Posts: 620
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Txt2Bas related question?

Post by iss » Tue Jul 03, 2018 7:32 am

Brana wrote:
Tue Jul 03, 2018 4:40 am
BUT IT JUST WORKS! :) :) :) :) :) :)
:shock: You rock, Brana!

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests