what's wrong with this program?

Basic and Machine Language

Moderator: Moderators

Post Reply
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

what's wrong with this program?

Post by ral-clan »

Hi folks,

Not a great programmer, but I want to make a program that will allow me to easily mount a disk image on my uIEC.

The normal immediate mode command to mount a disk image (assuming device 10) is:

OPEN15,10,15,"CD:DISKIMAGENAME.D64":CLOSE15

I am getting a syntax error in line 40. I just don't know enough about how to program device commands in BASIC properly.

10 PRINT 'MOUNT DISK IMAGE"
20 INPUT "WHAT DEVICE NUMBER';A
30 INPUT "DISK IMAGE NAME';B$
40 OPEN 15,A,15,"CD:";B$
50 CLOSE 15
60 PRINT "DISK ";B$;"MOUNTED."
Image Music I've made with 1980s electronics, synths and other retro-instruments: http://theovoids.bandcamp.com
merman
Vic 20 Enthusiast
Posts: 152
Joined: Thu Feb 25, 2016 9:46 am
Location: Skegness UK
Occupation: Writer

Re: what's wrong with this program?

Post by merman »

I *think* the problem is the way you are sending the command.

Try
35 CD$=CHR$(34)+"CD:"+B$+CHR$(34)
40 OPEN 15,A,15,CD$

Note this is presented without checking on real hardware.
groepaz
Vic 20 Scientist
Posts: 1180
Joined: Wed Aug 25, 2010 5:30 pm

Re: what's wrong with this program?

Post by groepaz »

just use +B$ instead of ;B$
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
Post Reply