home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
authors
/
len_tucker
/
stringtobank.amos
/
stringtobank.amosSourceCode
Wrap
AMOS Source Code
|
1986-08-03
|
841b
|
31 lines
Screen Open 0,640,256,4,Hires : Curs Off : Flash Off : Cls 0 : Paper 0
' these variables must be global in your main program
Global DELIMITER,POSINBANK
DELIMITER=10
POSINBANK=0
' remember to reserve a bank first
Reserve As Work 10,500
STRINGTOBANK_EASY[10,"This is test line"]
STRINGTOBANK_EASY[10,"for the string to bank routine."]
Bsave "temp.asc",Start(10) To Start(10)+POSINBANK
Procedure STRINGTOBANK_CLASSIC[BANK,N$]
If Length(10)>0
N$=N$+Chr$(DELIMITER)
Copy Varptr(N$),Varptr(N$)+Len(N$) To Start(BANK)+POSINBANK
Add POSINBANK,Len(N$)
Else
Print "Reserve a bank first.!!!"
End If
End Proc
Procedure STRINGTOBANK_EASY[BANK,N$]
If Length(10)>0
N$=N$+Chr$(DELIMITER)
PK=Start(BANK)+POSINBANK
For Z=1 To Len(N$)
Poke PK+(Z-1),Asc(Mid$(N$,Z,1))
Next Z
POSINBANK=POSINBANK+Len(N$)
Else
Print "Reserve a bank first.!!!"
End If
End Proc