Author Topic: how do I convert a text file to .bas?  (Read 10525 times)

0 Members and 1 Guest are viewing this topic.

Offline jwm

  • CPC464
  • **
  • Posts: 4
  • Liked: 1
  • Likes Given: 0
how do I convert a text file to .bas?
« on: 01:50, 31 December 11 »
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.

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1018
  • Likes Given: 926
Re: how do I convert a text file to .bas?
« Reply #1 on: 02:24, 31 December 11 »
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
« Last Edit: 02:28, 31 December 11 by 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

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1985
  • Likes Given: 4650
Re: how do I convert a text file to .bas?
« Reply #2 on: 03:05, 31 December 11 »
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

Offline jwm

  • CPC464
  • **
  • Posts: 4
  • Liked: 1
  • Likes Given: 0
Re: how do I convert a text file to .bas?
« Reply #3 on: 13:10, 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).




Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1018
  • Likes Given: 926
Re: how do I convert a text file to .bas?
« Reply #4 on: 13:31, 31 December 11 »
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

Offline jwm

  • CPC464
  • **
  • Posts: 4
  • Liked: 1
  • Likes Given: 0
Re: how do I convert a text file to .bas?
« Reply #5 on: 13:47, 31 December 11 »
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.

Offline Morn

  • 464 Plus
  • *****
  • Posts: 346
  • Country: de
  • Liked: 94
  • Likes Given: 73
Re: how do I convert a text file to .bas?
« Reply #6 on: 13:49, 31 December 11 »
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.

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.206
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1370
  • Likes Given: 2694
Re: how do I convert a text file to .bas?
« Reply #7 on: 13:57, 31 December 11 »
Typing 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

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1018
  • Likes Given: 926
Re: how do I convert a text file to .bas?
« Reply #8 on: 16:22, 31 December 11 »
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

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1018
  • Likes Given: 926
Re: how do I convert a text file to .bas?
« Reply #9 on: 17:36, 31 December 11 »
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)
« Last Edit: 17:44, 31 December 11 by 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

Offline jwm

  • CPC464
  • **
  • Posts: 4
  • Liked: 1
  • Likes Given: 0
Re: how do I convert a text file to .bas?
« Reply #10 on: 18:31, 31 December 11 »
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.







Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 17.007
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 4085
  • Likes Given: 7379
Re: how do I convert a text file to .bas?
« Reply #11 on: 20:21, 31 December 11 »
It was yours? My, never mind how bad it was, it's got a cult status... :)

Offline 00WReX

  • 6128 Plus
  • ******
  • Posts: 696
  • Country: au
  • The time you enjoy wasting is not wasted time.
    • index.php?action=treasury
    • CPCwiki
  • Liked: 404
  • Likes Given: 987
Re: how do I convert a text file to .bas?
« Reply #12 on: 04:32, 01 January 12 »
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

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1018
  • Likes Given: 926
Re: how do I convert a text file to .bas?
« Reply #13 on: 12:20, 01 January 12 »
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