[comp.sys.cbm] dynamic keyboard routine

seeley@dalcsug.UUCP (Geoffrey Seeley) (01/13/88)

	The following article is being posted in relation to Scott
Nickerson's article <268@dalcsug.uucp>, but the routine can be used to
program any SEQ file.
	 Scott mentions that the user can use a dynamic keyboard
technique to enter his program into the c64's memory. This saves much
wear and tear on the fingers. He did not include a routine to do this
so I decided that I would.

There is a simple method to capture a posting to disk and then have the
computer "program itself".

Step 1 : Find a terminal program that has a good buffer option. You should
	 be able to open and close the buffer while receiving text and you
	 should be able to save the buffer to disk (preferably as a SEQ file)
	 Boot up the terminal and log on to your system that contains the
	 text that you wish to capture.

Step 2 : On the main frame computer that you are using (I will be using a
	 VAX-750 for example), find the command to save the news
	 article to your directory. Or find a command that will list the
	 article directly to the screen. The command I use is:
	       
	       % pr -t /usr/spool/news/comp/sys/cbm/531
	 
	 this command will list article 531 of the news group comp.sys.cbm
	 on the screen.

Step 3 : Open the capture buffer just before you issue the command to 
	 print the news file to the screen. Send the command. After the
	 file has been listed, close the buffer. You can now logoff the
	 system.

Step 4 : Now save the buffer to disk. The format of this file should be
	 sequential but the program could be modified to work with
	 program files.

Step 5 : Boot up your favorite wordprocessor or any other SEQ file editor.
	 Edit out any unwanted text. i.e. anything that you don't want the
	 computer to enter into memory.
	 Save the edited file back to disk.

Step 6 : Enter the basic program below and substitute the filename of your
	 SEQ file in the OPEN command. Run the program and it will "enter"
	 the SEQ file into basic memory. Delete lines 0 to 8 and save the
	 resulting program to disk.

Here is the dynamic keyboard routine:

		0 rem z is the starting line number    i is the increment
		1 z=10:i=5:open1,8,0,"0:filename,s,r"
		2 poke152,1:print"[CLR][2 CRSR DOWNS]"z;:in$=""
		3 get#1,a$:ifa$=""then a$=chr$(0)
		4 ifst=66then close1:end
		5 ifa$>="A"anda$<="Z"thena$=chr$(asc(a$)-128)
		6 ifa$<>chr$(13)then in$=in$+a$:goto3
		7 print in$
		8 print "z="z+i"i="i"goto2 [HOME]";:poke631,13:poke632,13
		  :poke198,2:end

The trick to this program is fooling the computer into thinking that the
disk file has not been closed (the POKE in line 2). This is necessary
because when a line is entered into memory, the 64 will make it seem like
the file has been closed but in reality, it is still open.

I have used these methods to sucessfully capture and program the source
code for Frank Prindle's TERM PLUS 128 (It saved me alot of typing, maybe
it can do the same for you)

						Geoff Seeley
						(seeley@dalcsug)