> TxEd  > TxEd/src v0.30  Small text editor ('mode:A$=OS_GetEnv:init:=start% 2info: err:exit() <+:X%=ctrl%:Y%=X%256:ed%:edit menu F:exit(0): P: Zinit:ver$="0.30" dB ctrl% 31,name% 255:?name%=13:lf%=131:cr%=130:tb%=129:sp%=128 n+23,128,0,0,0,0,&7E,&42,&24,&18: space x#23,129,0,0,4,6,&7F,6,4,0: tab *23,130,0,2,2,&22,&62,&FE,&60,&20: cr "23,131,0,8,8,8,42,28,8,0: lf Cstart%=+4096:mtop%=memtop:end%=start%:here%=start%:top%=here% :line%=start%:?end%=13:x%=0:y%=0:hg%=0:file$="":ed%=: : ݤmemtop: =fx(132,0) :ș "OS_GetEnv" ,A%:=A% : 3ݤmode:A%=fx(135,0)256:>&8000:=A% =A%&80 : 8on:"FX4,2":"FX225,128":"FX226,144":"FX229,1": 3off:"FX4":"FX225,1":"FX226,128":"FX229": : "ݤerr:( &FE)=16:ed%:info ( &FE)=16:ed%=ed%:= "1:" at line "+Þ,<128 ( &FE)<>16):=-1 ,: 68info::"Small Text Editor v";ver$;" (C)1991 JGH"' @8"Bytes free ";mtop%-end%'"Bytes used ";end%-start%' J-"Editing ";file$;"",file$="")' T"Screen mode ";mode' ^,ht%=fx(160,9)255:wd%=fx(160,10)255: h: r&menu:off:"=> "A$:cmd:info | := : 8ݤcmd:A%=A$+" "," "):C$=uc(A$,A%-1)):A$=A$,A%+1) C$="MODE":=scrn C$="LOAD":=load C$="SAVE":=save C$="NAME":file$=A$:= 'C$="NEW":!start%=13:end%=start%:= C$,1)="*":C$+" "+A$:= "Mistake":= : (ݤload:A%=file(A$,5):A%<>1:X%!10=0 +X%!10>mtop%-start%:"File too long":= @"LOAD "+A$+" "+~start%:end%=start%+X%!10:?end%=13:file$=A$ 126 ctrl:0 v8$ptr%=K%+$ptr%:K%:x%=x%+1:ptr%=ptr%+1:pr(ptr%):0  : Ascr(here%): x%::pr(here%):here%=here%+1+$here%:=ht%here%>=end%:here%>=end%:x:"*End*";:y pr(here%)  : Dpr(p%):b(?p%):p%=p%+1:p%?-1=13 >=wd%:(wd%-);x%,);: : x:0:191: y:63:128: : =ins:line%>=end%-1:$line%=$name%:end%=line%+1+$line%: $$name%=$line%:$line%=$name%: $name%<$line%:s%=line%+1+$line%:$line%=$name%:d%=line%+1+$line%:$d%=$s%:d%=d%+1+$d%:s%=s%+1+$d%:s%>=end%:end%=d%:::: Not working here  s%=end%:s%=s%-1:s%?-1=13 s%=line%:d%=s%+$name%-$line%:end%=d%+1+$s%:$d%=$s%:d%=d%-1:s%=s%-1:s%?-1=13 s%=line%:s%=line%:$line%=$name%: :  ݤctrl:K%=8:K%=127 *4K%=141:?ptr%<>13:b(?ptr%):x%=:ptr%=ptr%+1:= HK%=140:ptr%>name%:=left R5ins:here%=line%+(ptr%-name%):K%=27:17,"Escape" \K%=13:=cr f)xx%=:yy%=:0,0);~K%;" ";xx%,yy%); p= z: Sݤcr::x%=0:here%=here%+1+$here%:line%=here%:line%>=end%:?end%=13:end%=end%+1 "y%=:=ht%:top%=top%+1+$top% %=ht% here%=end%-1:scr(here%) 0,y%);:= : ݤdel:ptr%<=name%:= Aptr%=ptr%-1:?ptr%<>9:$ptr%=$(ptr%+1):8:x%=x%-1:pr(ptr%):= $ptr%=$(ptr%+1):=back : 7ݤleft:ptr%=ptr%-1:?ptr%<>9:x%=x%-1:8:= =back : Rݤback:13:x%=0:pr(name%):p%=name%:x%=:b(?p%):p%=p%+1:p%>ptr%:x%,);:=     $(K%=141 here%start% ?(here%-1)>31 8:here%=here%-1:q: V1K%=140 here%>start% ?(here%-1)=13 left: ` K%=140 jK%=136 inschar: t K%=136 ~0K%=137 here%K%=157 prL(here%,here%+$here%):here%=here%+$here%:q: (K%=156 13:here%=thisL(here%):q:  Nleft:here%=here%-1:11:?(here%-1)<>13 e%=thisL(here%):prL(e%,e%+$e%) q: ;ݤthisL(ad%)::ad%=ad%-1:?(ad%-1)=13 ad%=start%:=ad%  ins(n%):end%>mtop%-n%-2 4 A%=end% here% -1:A%?n%=?A%::end%=end%+n%: mtop%-2  Cins(1):?here%=32:32,8:prL(here%,here%+1+$here%):x%,y%);:   ( 2 < F P Z2?here%=13 K%=13 ins(1):?here%=32:9,130,8,8 d*?here%=9 ins(1):?here%=32:9,129,8,8 njK%=13 32:=0:8:28,0,23,,+1,30,11,26,31,x%,y%,130::?here%=13:here%=here%+1:prH:x%,y%):q:0 x-K%=9 ?here%=9:prH:x%,y%);:b(9):8:q ?here%=K%:K%:p:0 0 : : : : 'prH:prL(here%,here%+1+$here%): prL(st%,en%): ad% #ad%=st%:::b(?ad%):ad%=ad%+1: L>=wd% ad%>=en%: ad%13:ad%=ad%+1:?ad%=13 ad%>=en%: ad%>=en%: ( DEFPROCz:COLOUR0:COLOUR129:ENDPROC  3b(B%):hg% B%>63 B%<128 x:B%:y:hg%=0: hg% x:42:hg%=0:y B%=28 x:45:y: "B%=29 hg%=: ,B%>31 B%<127 B%: 6B%=13 cr%,32,8: @B%=9 tb%:(8-( 8));: J#B%<32 0:129:B%+64:128:7: T ^ h r: |: : p:here%=here%+1:q: q:x%=:y%=: ݤx(A$):="HELLO" " > BLib.FileIO 1.01 07Sep2006 < v1.01 07Sep2006 JGH: FNargs avoid zero page on RISC OS * v1.00 09Aug1988 JGH: Initial version : % General File Interface Routines % =============================== : , Returns file type, file info in X%!... , -------------------------------------- Bݤfile(A$,A%):$name%=A$:?X%=name%:X%?1=name%256:=(&FFDD)&FF :  General OSGBPB call & ------------------- 0Ugbpb(A%,chn%,addr%,num%,ptr%):?X%=chn%:X%!1=addr%:X%!5=num%:X%!9=ptr%: &FFD1: :: D@ Return current disk (5), directory (6) or library (7) name N@ ---------------------------------------------------------- XBݤgbpb(A%):X%!1=name%:&FFD1:A%=name%+((1+?name%)((A%-2)=6)) bA%?(1+?A%)=13:=$(A%+1) l: vB Returns entry in current directory, or null string if at end B ------------------------------------------------------------ Eݤgbpb8(ptr%):X%!1=name%:X%!5=1:X%!9=ptr%:A%=8:&FFD1:X%!5=1:="" #A%=name%:A%?(1+?A%)=13:=$(A%+1) : 7 OSARGS call with data. Returns any returned data 7 ------------------------------------------------- 4ݤargs(A%,Y%,ptr%): X%,E%:?(P-3)=0:E%=Y%:Y%=0 /<&8000: !&70:X%=&70:!X%=ptr%:&FFDA:=!X% )ș"OS_Args",A%,Y%,ptr% ,,ptr%:=ptr% : ' OSARGS call ignoring X, returns A ' --------------------------------- =ݤargsA(A%):<&8000: X%,Y%,E%,!&70:X%=&70:=(&FFDA)&FF ș"OS_Args",A% A%:=A%  : & Get current filing system number  & -------------------------------- *!ݤfs: A%,Y%,E%:=(&FFDA)&FF 4 > BLib.MOS 1.00 09Aug1998 >: H$ General MOS Interface Routines R$ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \: f Osbyte Calls p ~~~~~~~~~~~~ z: J FNbyte returns the single byte in the X register for the named call. 1 FNfx returns the two-byte value held in XY. )ݤbyte(A%,X%,Y%)=((&FFF4)&FF00)256 6ݤfx(A%,X%): Y%:Y%=X%256:=((&FFF4)&FFFF00)256 " > BLib.String 1.00 09Aug1998 : # String Manipulation Functions # ============================= : 7 FNs() - strip spaces from start and end of string 7 ------------------------------------------------- /ݤs(A$):A$,1)=" ":A$=A$,2):A$,1)<>" " +A$,1)=" ":A$=A$,A$-1):A$,1)<>" " =A$ : + FNuc() - convert string to upper case $+ ------------------------------------- .ݤuc(A$): B$:A$="":="" 85B$=B$+(A$((A$<"@")&DF)):A$=A$,2):A$="":=B$ B: L+ FNlc() - convert string to lower case V+ ------------------------------------- `ݤlc(A$): B$:A$="":="" j5B$=B$+(A$((A$<"_")&20)):A$=A$,2):A$="":=B$ t: ~# > BLib.ProgEnv 1.04 09Jan2007 : # Program Environment Functions # ============================= : ? Return command line tail, sets run$ to execution filename ; Works with BASIC on I/O,T6502,Arc,TZ80BBC,PC,Win,TARM ; Needs: 270 free bytes above end of heap for temp. w/s ? --------------------------------------------------------- :ݤOS_GetEnv:A$,A%:X%=1:os%=((&FFF4)&FF00)256:X%-1 Jos%=32:>&FFFF:ș"GetModuleFileName",0,X%,255:A$=$$X%:run$=A$:=@cmd$ os%=32:A$=$&100 {A$=0:>&7FFF:run$=$&8100:ș"OS_GetEnv"A$,,A%:ș"OS_WriteEnv","",A%:A$=A$,1+A$+" "," ",1+A$," "))):A$=0:A$=run$ 2A$=0:?(P-3):A$=$&600 A$=0:A$=$(-&300) 7A%=A$+" "," "):run$=A$,A%-1):run$<>"":=A$,A%+1) bY%=X%256:A%=9:?X%=0:X%!1=X%+16:X%!16=0:&FFD1:A%=X%+16:!A%?A%+A%?2<>8:A%?(A%+1)=13:=$(A%+1) ="" (: 2. Run a program, passing it a command line <= If program is *Command, called with OSCLI, else CHAINed F= ------------------------------------------------------- P&os(A$):A$=42:A$ A$<>"":A$ Z d: n( Exit program, setting return value x( ---------------------------------- @exit(A%):"FX1,"+A%:quit$=quit$:A$=quit$:quit$="":os(A$) os%=32:Ș A% os%<6: *Quit  :