[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BASIC Help



I'm in the process of trying to modify, for a member of my Apple
club, the BASIC program "HOME ACCOUNTING" so it will run from a hard
drive.

The main problem with the program is that it is a DOS 3.3 program
ported over to ProDOS, however, the authors kept with the Slot/Drive
convention rather than convert to pathnames.

The first program run is "HAMENU" and I've modified it so that it
seems to run correctly through at least part of the code.

Below I have the changes to HAMENU. Those lines preceeded with a "<"
are the original lines and those preceeded with a ">" are the
changed lines.

On entry HAMENU does a little set up work and then goes to location
60000. It was at that point that I changed the existing line number
to 60002 and put in my own 60000 that set up PX$ with the current
prefix. Then, at each point in the program where they currently used
the Slot/Drive convention I substituted PX$ (see below).

Unfortunately, when I select another module to run (e.g.
TRANSACTIONS), it loads the BASIC program fine, however, almost
immediately I get an "OUT OF MEMORY" error, number is 77.

I'd appreciate any ideas on just what I've done wrong here. Also,
I'll gladly listen if you have any ideas on how better to approach
this problem of making the program HD/pathname aware.

42c41,43
<  650  HOME : VTAB 8: POKE 36,20: PRINT AS$: VTAB 14: POKE 36,20:
PRINT AS$: VTAB 10: POKE 36,33: INVERSE : PRINT NL$: PRINT : POKE
36,39 -  LEN (MU$(SL)) / 2: PRINT " "MU$(SL)" ": NORMAL : VTAB 20:
PRINT  CHR$ (4)"RUN" LEFT$ (MU$(SL),6)",D1": END
---
>  650  HOME : VTAB 8: POKE 36,20: PRINT AS$: VTAB 14: POKE 36,20:
PRINT AS$: VTAB 10: POKE 36,33: INVERSE
>  651  PRINT NL$: PRINT : POKE 36,39 -  LEN (MU$(SL)) / 2: PRINT "
"MU$(SL)" ": NORMAL : VTAB 20
>  652  PRINT D$"RUN"PX$ +  LEFT$ (MU$(SL),6): END

76,82c77,83

<  3000  PRINT D$"OPEN HAPROG,D1": PRINT D$"READ HAPROG": INPUT AD$:
INPUT PD$:
INPUT BW$: INPUT MF$: PRINT D$"CLOSE HAPROG":YY$ =  RIGHT$ (AD$,2):
RETURN
<  3003  PRINT D$"OPEN HAPROG,D1": PRINT D$"WRITE HAPROG": PRINT
DA$: PRINT PD$: PRINT BW$: PRINT MF$: PRINT D$"CLOSE HAPROG": GOSUB
4000: RETURN
<  3004  PRINT D$"VERIFY HAPROG2,D1": RETURN
<  3005  PRINT D$"VERIFY HAPROG,D1": RETURN
<  3800  PRINT D$"CLOSE": PRINT D$"OPEN HARDWARE,D1": RETURN
<  3810  PRINT D$"READ HARDWARE": INPUT FT%: FOR X = 1 TO 14: INPUT
HW$(X): NEXT X:PS% =  VAL (HW$(1)):ND% =  VAL (HW$(14)): PRINT D$:
RETURN
<  3830  PRINT D$"CLOSE HARDWARE": RETURN
---
>  3000  PRINT D$"OPEN"PX$"HAPROG": PRINT D$"READ"PX$"HAPROG": INPUT
AD$: INPUT PD$: INPUT BW$: INPUT MF$: PRINT D$"CLOSE"PX$"HAPROG":YY$
= RIGHT$ (AD$,2): RETURN
>  3003  PRINT D$"OPEN"PX$"HAPROG": PRINT D$"WRITE"PX$"HAPROG":
PRINT DA$: PRINT PD$: PRINT BW$: PRINT MF$: PRINT
D$"CLOSE"PX$"HAPROG": GOSUB 4000: RETURN
>  3004  PRINT D$"VERIFY"PX$"HAPROG2": RETURN
>  3005  PRINT D$"VERIFY"PX$"HAPROG": RETURN
>  3800  PRINT D$"CLOSE": PRINT D$"OPEN"PX$"HARDWARE": RETURN
>  3810  PRINT D$"READ"PX$"HARDWARE": INPUT FT%: FOR X = 1 TO 14:
INPUT HW$(X): NEXT X:PS% =  VAL (HW$(1)):ND% =  VAL (HW$(14)): PRINT
D$: RETURN
>  3830  PRINT D$"CLOSE"PX$"HARDWARE": RETURN
104c105,106
<  60000  FOR X = 0 TO 38:BL$ = BL$ + " ":UL$ = UL$ +  CHR$ (95):EQ$
= EQ$ + "=":MI$ = MI$ + "-":AS$ = AS$ + "*": NEXT :D$ =  CHR$ (4):
GOSUB 3900: GOSUB 3005:BE$ =  CHR$ (7):LG = 1:NL$ = " NOW LOADING
":NU$ = CHR$ (0) +  CHR$ (0):FT$(1) = "6"
---
>  60000 D$ =  CHR$ (4): PRINT D$;"PREFIX": INPUT PX$
>  60002  FOR X = 0 TO 38:BL$ = BL$ + " ":UL$ = UL$ +  CHR$ (95):EQ$
= EQ$ + "=":MI$ = MI$ + "-":AS$ = AS$ + "*": NEXT : GOSUB 3900:
GOSUB 3005:BE$ =  CHR$ (7):LG = 1:NL$ = " NOW LOADING ":NU$ =  CHR$
(0) + CHR$ (0):FT$(1) = "6"

One final thing. The program uses a data disk &/or pathname.
Currently, it simply assumes it is in Drive 2. Not going to be true
for when I get done. Is this the best way to handle this situation?

1. Have a default (or none) pathname stored in a txt file (The
program does this for other things now so I could simply add another
item).

2. Ask the user at boot time if the default is O.K., and if so
continue, if not, ask for the new.

Kind Regards, Joe Walters


-- 
	Joe Walters:  bird@mcs.com or J.L.Walters@genie.com
	To know and not to do is to not yet know