Originally posted by: wkk5231@acf4.UUCP (Wesley Kaplow)
Message-ID: <1000001@acf4.UUCP>
Date: Sat, 12-Jan-85 05:39:00 EST
Article-I.D.: acf4.1000001
Posted: Sat Jan 12 05:39:00 1985
Date-Received: Sun, 13-Jan-85 09:07:26 EST
Organization: New York University
Lines: 37
**********
Note: this note is not really from wkk5231@acf4. It is from
...cmcl2!alaya!alan (alaya!alan@cmcl2, or "Alan Shaw").
If you reply by mail, please address your reply accordingly.
**********
What is wrong with the following program? I wrote it to upload seq files from
disk to our VAX. I log in, enter vi, and then run the program. It works just
fine for short files, but when I try it on a long one, a chunk of text from
the middle of the file (from the 6366th byte on, to be precise) gets lost.
Or perhaps it's not the program that's at fault?
Any suggestions will be appreciated.
10 nn$="":print"enter filename: ";
20 geta$:ifa$=""then20
30 printa$;:if(a$=chr$(20))and(len(nn$)>0)thennn$=left$(nn$,len(nn$)-1):goto20
35 ifa$=chr$(20)then20
40 ifa$=chr$(13)then100
50 nn$=nn$+a$:goto20
100 open9,8,9,nn$+",s,r"
105 open15,8,15:input#15,a$,b$,c$,d$:ifa$<>"00"thenprinta$,b$,c$;d$:close15:end
110 open2,2,255,chr$(6)+chr$(0)
120 get#2,b$
130 print#2,chr$(17);chr$(27);:a$="a":a=-1:goto150:rem the "a" is append in vi
140 get#9,a$:a$=left$(a$+chr$(0),1):su=st
150 f=fre(0):gosub5000:print#2,a$;:a=a+1:printa,int(a/256)
155 print"{cursor-up}";
160 get#2,b$:ifsu=64thenclose2:close9:end
170 goto140
5000 rem pet to ascii
5010 z=asc(a$):ifz<65then return
5020 ifz>90then5040
5030 z=z+32
5040 ifz<219then5060
5050 z=z-96
5060 z=zand127
5070 a$=chr$(z):return