From: St. Nick of the A2 Subject: Self Modifying Applesoft BASIC code MIME-Version: 1.0 Date: Fri, 20 Nov 1998 10:23:31 PST Self Modifying Applesoft BASIC code, some useful AppleSoft BASIC programming info. ]0 TEXT : HOME : GOTO 100 ]1 NORMAL : NOTRACE : SPEED= 255: TEXT :PRINT CHR$ (4)"PR#3": PRINT : POKE 33,73: LIST : VTAB 1: END ]15 & SAVE "MYFILE.01234567": RETURN ]16 PK = PEEK (121) + PEEK (122) * 256 - 18 ]17 FOR PL = 0 TO 14: POKE PK + PL, ASC ( MID$ (NA$,PL + 1,1)): NEXT : GOTO 1 ]100 NA$ = "YOUR.FILE": IF LEN (NA$) < 15 THEN NA$ = NA$ + " ":NA$ = LEFT$ (NA$,15): REM 15 Spaces ]110 GOSUB 16 Line 0 clears the screen and goes to line 100, which has the desired file name stored in variable NA$ this is padded out to a length of 15 characters with spaces if needed. (For this to work correctly the file name will allways need to have 15 characters in it.) Line 110 calls the change the file name subroutine. Line 16 peeks the zero page for the address of the current line being processed. The "-18" at the end of the line ajdusts that number for the offset to the beginning of the file name in the previous line. Line 17 pokes in the actual file name you want to use. Then lists the program so you can see that it was changed. In actual use change the "GOTO 1" at the end of line 17 to "GOTO 15". You can put in any file name you like in "NA$" from 1 to 15 characters long, experiment a little with it.