News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

how do I convert a text file to .bas?

Started by jwm, 00:50, 31 December 11

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jwm

Hi,

I've just typed in some code from a magazine scan and saved it as a text file on my Linux box. I then used iDSK (along with translate.google.com) to put the file as a .bas within a dsk file. It didn't work. I then remembered that in cpc memory commands are not stored as text. I assume then that a .bas file isn't a real text file? If not, how can I convert it?

Cheers,
James.

Devilmarkus

#1
Perhaps my little tool can help you...

http://www.cpcwiki.eu/forum/applications/baslist-java-tool-to-list-basic-files/msg29481/#msg29481

Cheers,
Markus

Edit:
Got it wrong first:
To transform a .TXT file to .BAS:
- Put a .TXT file on your DSK without adding an Amsdos header
- Rename it to xxxx.BAS
- LOAD"xxxx.BAS"
- SAVE"xxxx.BAS"

Then you should have your proper .BAS file
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

TFM

Why not just typing it in on a real CPC?
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

jwm

Quote from: TFM/FS on 02:05, 31 December 11
Why not just typing it in on a real CPC?

Around ten years ago I donated my real CPC 464 to an old landlord because I couldn't be bothered to take it with me when I moved and I had a PC. :(

Typing within the emulator (arnold) is impossible; for example to type the + character I had to copy the output of print chr$(43).




Devilmarkus

When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

jwm

Hi Markus,

I tried your tool but had no luck with that - I got lots of errors on the console.

I also tried your other suggestion. After renaming it and I do the load I get a "Memory Full" error.

I'm trying to get CPCtools to work but for that, I also need libserial to build and I keep getting a python error during make... I don't know python but am going to try to look into it.

Cheers,
James.

Morn

You can save the BASIC source code as an ASCII file to the DSK image (with iDSK -t 0). It will load about 10 times or so slower on the CPC than a binary BASIC file though. Then save the code in the emulator in standard binary format.

You also have to convert line endings to the standard CP/M / DOS CR/LF convention first if you are using e.g. a Mac, otherwise the BASIC interpreter won't read the ASCII file.

mr_lou

Quote from: jwm on 12:10, 31 December 11Typing within the emulator (arnold) is impossible; for example to type the + character I had to copy the output of print chr$(43).

Good to hear I'm not the only one.
To load from tape I have to first print chr$(124) to get the | character, then copy that and type TAPE

Devilmarkus

Please email me your textfile (or MSN)
webmaster[at]cpc-live.com
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

#9
Here's your DSK:

But I also adapted this game from speccy:
http://www.cpc-power.com/index.php?page=detail&num=6262


Advanced Lawnmower Simulator for Amstrad CPC

;)

DUMMY.BAS: Your textfile (ASCII)
LWM.BAS the adapted file to BASIC code

You had an error in line 430... (There are some more bugs but you'll find that out)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

jwm

Thanks Markus,

Have to say I'd forgotten how bad that game was. I was proud to get it printed in Amstrad Action at the time..

http://cpcoxygen.fxwebdevelopment.com/aa_depot/052JS.html

I've watched a few videos of Advanced Lawnmower Simulator on youtube, never saw it until now.

James.







Gryzor

It was yours? My, never mind how bad it was, it's got a cult status... :)

00WReX

Hahaha...classic.

Love it near the end of the video..."You Have Been Killed"... :D
Sh!t I was only mowing the grass...

Cheers,
Shane
The CPC in Australia...
Awa - CPCWiki

Devilmarkus

Now you can also play it online!


Happy New Year! ;)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Powered by SMFPacks Menu Editor Mod