home *** CD-ROM | disk | FTP | other *** search
- 5 iffl=0thenfl=1:load"dp] ssort",8,1
- 6 iffl=1thenfl=2:load"dp] dos5.1",8,1
- 7 iffl=2thenfl=3::sys52224
- 8 rem ssort by david peterson, dos5.1 (c) by commodore
- 10 rem datafile 3.6 (c)1986 by mike konshak
- 12 poke53280,0:poke53281,0:print"[158]":gosub16:gosub600:goto68
- 16 d$="":mr$=d$:dr$=d$:s=0:b1$=d$:pw=0:cw=0:b$=chr$(32):fl=0:l$="":e=0
- 18 nc=0:nl=0:pg=0:f1=0:f2=0:f3=0:l$=d$:rl=0:sb$=d$:cr$=chr$(13):hn$=d$:id$=d$
- 20 a$=d$:c$=d$:t%=0:i$=d$:ck=0:i=0:j=0:k=0:l=0:m=0:n=0:rw=5:sf=0:z=0:e$="eof"
- 22 en=0:em$=d$:et=0:es=0:a1$=d$:a2$=d$:a3$=d$:s1$=d$:ts%=0:mem=29500:return
- 24 dim f$(f+1),l%(f+1):return
- 26 dim rec$(r+1,f+1),k%(r+1),s(6):return
- 28 :
- 30 geta$:ifa$=""then30
- 32 return
- 34 :
- 36 ifck<>0thengosub394:ifa$<>"n"then68
- 37 clr:goto40
- 38 print"[147] initialize (create) a record file ":return
- 40 gosub38:gosub16:input"how many fields in each record[158]? 0 [157][157][157][157]";f
- 41 iff=0then68
- 42 gosub24
- 43 fori=1tof
- 44 gosub38:print"[153]field #";i:print"[153]title[158] ? >[145]":printtab(8)f$(i)
- 46 print"[153]length[158]? 0[145]":printtab(7)l%(i)""
- 47 print"";tab(6);:inputf$(i):iff$(i)=""thenf$(i)=">"
- 48 printtab(6);:inputl$:ifl$="0"then68
- 49 ifval(l$)>(78-len(f$(i)))orval(l$)=0thengosub602:print"[145][145]":goto48
- 50 l%(i)=val(l$):nexti:rl=0
- 51 :
- 52 forj=0tof:rl=rl+l%(j):nextj:rl=rl+3*(f+1)+5:r=int((mem-12*(f+1)-2100)/rl)
- 54 print"[153] your selections allow [158]"r"[153]records."
- 56 print" a[146][153]ccept c[146][153]hange field data or r[153][146]eject?[158]"
- 57 gosub30:ifa$="r"then37
- 58 ifa$="c"then43
- 59 ifa$="a"thengosub26:ck=1:goto61
- 60 gosub602:goto57
- 61 fori=1tof:iflen(f$(i))>s1thens1=len(f$(i))
- 62 nexti:goto68
- 64 :
- 68 print"[147][158] datafile 3.6 (c)1986 by mike konshak "
- 70 printtab(3)"c[153][146]reate new file q[153][146]uit program
- 72 [153][163]3)"aprintwaitdd record to current file
- 74 printtab(3)"m[153][146]odify record in current file
- 76 [153][163]3)"dprintwaitelete record in current file
- 78 printtab(3)"v[153][146]iew or edit file [158]"nf$"[146][153]
- 80 [153][163]3)"sprintwaitort records by field
- 82 printtab(3)"p[153][146]rint records using [158]dfprint[153]/[158]dfcalc
- 84 [153][163]3)"rprintwaitead (load) old file from disk
- 86 printtab(3)"w[153][146]rite (save) current file to disk
- 88 [153][163]3)"@printwait disk drive commands $wait 4waitprint directory"
- 90 [153]"sys press the appropriate key "
- 92 [153]"print there aresys";x;"printrecords in memorysys"
- 94 [139]r[177]0[167][153]"print space forsys";r[171]x;"printmore recordsonsys"
- 96 [141]30:[139]a$[178]"a"[167][141]350:[139]fl[178]0[167]124
- 98 [139]a$[178]"m"[167][141]354:[139]fl[178]0[167]244
- 100 [139]a$[178]"d"[167][141]354:[139]fl[178]0[167]272
- 102 [139]a$[178]"c"[167]36
- 104 [139]a$[178]"r"[167]170
- 106 [139]a$[178]"p"[167]358
- 108 [139]a$[178]"v"[167][141]354:[139]fl[178]0[167]192
- 110 [139]a$[178]"w"[167][141]350:[139]fl[178]0[167]144
- 112 [139]a$[178]"s"[167][141]354:[139]fl[178]0[167]304
- 114 [139]a$[178]"q"[167]342
- 116 [139]a$[178]"@"[167]462
- 117 [139]a$[178]"$"[176]a$[178]"4"[167][141]422:[137]68
- 118 [139]fl[179][177]0[167]fl[178]0:[137]68
- 120 [141]602:[137]96
- 122 :
- 124 [129]i[178]x[170]1[164]r:[153]"loadprint press the returnwaitprint key after each entry"
- 126 [153]" press returnprintwait without any entry to stopsys"
- 128 [153]" record number ";i;""
- 130 [129]n[178]1[164]f
- 132 [153]f$(n)[166]s1[171][195](f$(n)))" >cmdcmdcmd";:[133]rec$(i,n)
- 133 [139]rec$(i,n)[178]""[167]rec$(i,n)[178]">"
- 134 [139][195](rec$(i,n))[177]l%(n)[167][141]140:[137]132
- 135 [139]rec$(i,n)[178]"="[167]rec$(i,n)[178]rec$(i[171]1,n)
- 136 [139]rec$(i,1)[178]">"[167] x[178]i[171]1:ck[178]1:[137]68
- 138 [130]n:k%(i)[178]i:[130]i:x[178]r:ck[178]1:[137]68
- 140 [153]" defcannot exceed"[196](l%(n))" characterswaitsys":[141]602:[142]
- 142 :
- 144 [153]"loadprintenter name of current file to be saved"
- 146 [153]"(12 characters max). any existing file"
- 148 [153]"with the same name will be scratched.sys"
- 150 [153]" ";nf$:[133]"on";nf$:[139]nf$[178]""[167]68
- 152 [159]15,8,15:[152]15,"s0:df] "[170][200](nf$,8)[170]".bak":[141]414:[139]et[178]8[167]68
- 154 [152]15,"r0:df] "[170][200](nf$,8)[170]".bak=df] "[170]nf$:[141]414:[139]et[178]8[167]68
- 156 [159]5,8,5,"0:df] "[170]nf$[170]",s,w":[141]414:[139]et[178]8[167]68
- 158 [152]5,r;cr$;f;cr$;x:[129]n[178]1[164]f:[152]5,f$(n);cr$;l%(n):[130]n
- 159 [141]414:[139]et[178]8[167]68
- 160 [129]i[178]1[164]x:[153]"print saving record #sys"i"onon"
- 162 [129]n[178]1[164]f:[152]5,rec$(k%(i),n):[130]n:[130]i:[153]:[141]414:[139]et[178]8[167]68
- 166 [160]5:[160]15:ck[178]0:[137]68
- 168 :
- 170 [139]ck[179][177]0[167][141]394:[139]a$[179][177]"n"[167]68
- 171 [153]"loadprint available files on disk are:sys":@"$0:df]*"
- 172 [156]:[141]16:[153]"print enter name of file to be loadedsys":[133]nf$
- 173 [139]nf$[178]""[167]68
- 174 [159]15,8,15:[159]5,8,5,"0:df] "[170]nf$[170]",s,r":[141]414:[139]et[178]8[167]68
- 175 [139]en[178]62[167][141]416:[137]68
- 176 [132]5,r,f,x:[141]414:[139]et[178]8[167]68
- 177 [141]24:[141]26:[129]n[178]1[164]f:[132]5,f$(n),l$:l%(n)[178][197](l$)
- 178 [130]n:[141]414:[139]et[178]8[167]68
- 179 [129]i[178]1[164]x:k%(i)[178]i:[153]"printloading record #sys"i"onon"
- 180 [129]n[178]1[164]f:[132]5,rec$(i,n):[130]n
- 182 [130]i:[153]:[141]414:[139]et[178]8[167]68
- 184 s[178]st:[139]s[179][177]0[167]188
- 188 [160]5:[160]15:[137]61
- 190 :
- 192 i[178]1
- 194 [139]i[178]0[167]i[178]x
- 196 [139]i[177]x[167]i[178]1
- 198 [153]"load record number:"[196](i)" file:"nf$""
- 200 [129]n[178]1[164]f:[153]"print"f$(n)[166]s1[171][195](f$(n)))" sys"rec$(k%(i),n):[130]n
- 202 [153]" nprintwaitext lprintwaitast jprintwaitump fprintwaitind"
- 203 [153]" mprintwaitodify dprintwaitelete pprintwaitrint eprintwaitxitsys"
- 204 [141]30:[139]a$[178]"n"[167]i[178]i[170]1:[137]194
- 206 [139]a$[178]"l"[167]i[178]i[171]1:[137]194
- 207 [139]a$[178]"m"[167][141]256:[137]198
- 208 [139]a$[178]"j"[167]216
- 209 [139]a$[178]"d"[167][141]284:[137]198
- 210 [139]a$[178]"f"[167]218
- 212 [139]a$[178]"e"[167]68
- 213 [139]a$[178]"p"[167][159]4,4:[152]4,"record#"i"in file: "nf$:[152]4:[137]215
- 214 [141]602:[137]204
- 215 [129]n[178]1[164]f:[152]4,rec$(k%(i),n):[130]n:[152]4:[152]4:[160]4:[137]204
- 216 [133]"print jump to record numbersys";i:[137]194
- 218 [153]"load find records with common items "
- 220 [129]n[178]1[164]f:[153]" ";n;"printwait ";f$(n):[130]n
- 222 [133]"print which field is to be searchedsys? 0 cmdcmdcmdcmd";sf:[139]sf[178]0[167]68
- 224 [139]sf[179]1[176]sf[177]f[167][153]"ononon":[137]222
- 226 [153]"print enter common itemwait ":[153]" (the entire string is not required)sys"
- 228 [153]"";f$(sf);"wait ";:[133]t$:[139]t$[178]d$[167]68
- 230 j[178]i:[129]i[178]1[164]x:[153]"print searching recordssys"i"onon"
- 232 [139]t$[178][200](rec$(k%(i),sf),[195](t$))[167]236
- 234 [137]241
- 236 j[178]i:[153]"load record #";i;""
- 237 [129]n[178]1[164]f:[153]"print"f$(n)[166]s1[171][195](f$(n)))" sys"rec$(k%(i),n):[130]n
- 238 [153]" nprintwaitext mprintwaitodify dprintwaitelete ewaitprintxitsys":[141]30:[139]a$[178]"e"[167]198
- 239 [139]a$[178]"m"[167][141]256:[137]236
- 240 [139]a$[178]"d"[167][141]284:[137]236
- 241 [130]i:i[178]j:[137]198
- 242 :
- 244 [153]"loadprint modify which record? enter #waitprint or aprintwaitllsys"
- 245 [133]mr$:[139]mr$[178]d$[167]68
- 246 [139]mr$[178]"a"[167]mr$[178]d$:[137]254
- 248 i[178][197](mr$):mr$[178]d$
- 250 [139]i[177]x[167][141]348:[137]244
- 252 [141]256:[137]68
- 254 [129]i[178]1[164]x:[141]256:[153]" nwaitprintext or eprintwaitxitsys":[141]30:[139]a$[178]"e"[167]68
- 255 [130]i:[137]68
- 256 [153]"loadprint to modify record #sys";i;"print, make changes"
- 258 [153]" as each field is displayed, then returnwaitsys":[129]n[178]1[164]f
- 260 [153]"print"f$(n)" sys":[153]" ";rec$(k%(i),n)
- 261 [139][195](rec$(k%(i),n))[177]36[167][153]"on";
- 262 [153]"on ";:[133]rec$(k%(i),n)
- 264 [139][195](rec$(k%(i),n))[177]l%(n)[167][141]140:[137]260
- 265 [139]rec$(k%(i),n)[178]"="[167]rec$(k%(i),n)[178]rec$(k%(i[171]1),n)
- 266 [139]rec$(k%(i),n)[178]""[167]rec$(k%(i),n)[178]">"
- 267 [139][200](rec$(k%(i),n),1)[178]">"[167]rec$(k%(i),n)[178]">"
- 268 [130]n:ck[178]1:[142]
- 270 :
- 272 [153]"loadprint delete which record? enter #printwait or aprintwaitllsys"
- 274 [133]dr$:[139]dr$[178]d$[167]68
- 276 [139]dr$[178]"a"[167]dr$[178]d$:[137]282
- 278 i[178][197](dr$):dr$[178]d$:[139]i[177]x[167][141]348:[137]274
- 280 [141]284:[137]68
- 282 [129]i[178]1[164]x:[141]284:[153]" nwaitprintext or ewaitprintxitsys":[141]30:[139]a$[178]"e"[167]68
- 283 [130]i:[137]68
- 284 [153]"loadprint to delete record numbersys";i;"print, press"
- 286 [153]" shiftwait dwaitprint, press space barwaitprint to advancesys"
- 288 [129]n[178]1[164]f:[153]"print"f$(n)[166]s1[171][195](f$(n)))" sys"rec$(k%(i),n):[130]n
- 290 [141]30:[139]a$[178]"str$"[167]294
- 292 ck[178]1:[142]
- 294 [153]"deleting record";i:[153]"records may now be out of order"
- 296 [129]n[178]1[164]f:rec$(k%(i),n)[178]rec$(x,n):rec$(x,n)[178]"":[130]n
- 298 [129]j[178]1[164]x:[139]k%(j)[178]x[167]k%(j)[178]k%(x):k%(x)[178]0:x[178]x[171]1:[137]292
- 300 [130]j
- 302 :
- 304 [153]"load sort records in ascending order "
- 306 [129] n[178]1[164]f:[153]" ";n;"wait ";f$(n):[130]n
- 308 [129]n[178]0[164]5:s(n)[178]0:[130]n
- 310 n[178]0:[153]"print enter 0waitprint to exit field selection"
- 312 n[178]n[170]1:[139]n[178]6[167]320
- 314 [153]"print # "n"printwaitfield to be sortedsys? 0 cmdcmdcmdcmd";:[133]s(n):[139]s(1)[178]0[167]68
- 316 [139](s(n)[177]f)[176](s(n)[179]0)[167][153]"onon":[137]314
- 318 [139]s(n)[179][177]0[167]312
- 320 [153]" sorting..."
- 322 l[178]r[170]1:[158]51526,l,x,f,s(1),s(2),s(3),s(4),s(5),s(0),rec$(1,s(1))
- 324 [129]i[178]1[164]x:k%(i)[178]i:[130]
- 326 ck[178]1:[137]68
- 333 :
- 334 [153]"load defyou have not saved your changes!sys"
- 336 [153]"print do you really want to quit? defyprintwait or nwaitsys
- 338 gosub30:ifa$="y" then344
- 340 goto68
- 342 ifck<>0then334
- 344 print"[147]datafile terminated":end
- 346 :
- 348 print" [150]no such record exists[158]":return
- 350 ifr>0thenreturn
- 352 print" [150] no records or files in memory [158][146]"
- 353 fori=1to500:nexti:fl=1:return
- 354 ifx>0thenreturn
- 355 gosub352:return
- 356 :
- 358 ifck<>0thengosub394:ifa$<>"n"then68
- 360 print"[147] transfer to printing programs "
- 362 print"[153]put [158]datafile[153] disk in drive, transfer to:"
- 364 printtab(6)"p[146][158] dfprint [153]reports-labels-lists"
- 366 printtab(6)"c[146][158] dfcalc [153]calculated reports"
- 368 printtab(6)"e[146][153]xit to main menu[158]
- 370 [153]" press the appropriate key "
- 372 [141]30:[139]a$[178]"e"[167]68
- 374 [139]a$[178]"c"[167][153]"loadstopload"[199](34)"dfcalc"[199](34)",8":[137]380
- 376 [139]a$[178]"p"[167][153]"loadstopload"[199](34)"dfprint"[199](34)",8":[137]380
- 378 [141]602:[137]372
- 380 [153]:[153]:[153]:[153]:[153]"runsys"
- 382 [151]631,19:[151]632,13:[151]633,13:[151]634,13:[151]635,13:[151]636,13
- 384 [151]198,6:[162]:[128]
- 392 :
- 394 [153]"load defthis will destroy the file in memory!sys"
- 396 [153]"print save the file first? yprintwait or defnsyswait":[141]30:[142]
- 400 :
- 402 [153]"loaddef this will erase the disk!sys"
- 403 [153]"print are you sure? defywaitprint or nwaitsys
- 404 gosub30:ifa$="n"then68
- 406 ifa$<>"y"then68
- 407 print"[153] press return[146][153] without an entry to exit[158]"
- 408 input" disk name,id[146]";hn$,id$:ifhn$=d$then68
- 410 open15,8,15:print#15,"new0:"+hn$+","+id$:gosub414:ifet=8then462
- 411 close15:goto462
- 412 :
- 414 input#15,en,em$,et,es:if(en<20)or(en=62)thenet=0:return
- 416 print" [150]disk error[146]"en"[157], "em$","et"[157],"es"[158]":et=8
- 418 print"[153] press any key[146][153] to return to menu[158]":gosub30:close5:close15:return
- 420 :
- 422 print"[147]":@"$":printtab(25)"press any key[146][153]":gosub30:return
- 460 :
- 462 print"[147][158] disk commands menu "
- 464 printtab(11)"$[153][146] disk directory
- 466 [153][163]11)"fprintwaitormat a blank disk
- 468 printtab(11)"s[153][146]cratch a seq file
- 470 [153][163]11)"rprintwaitename a seq file
- 471 printtab(11)"v[153][146]alidate a disk
- 472 [153][163]11)"eprintwaitxit to main menusys
- 474 print" press the appropriate key "
- 476 gosub30:mr$=d$:dr$=d$:ifa$="$"ora$="4"thengosub422:goto462
- 478 ifa$="f"then402
- 480 ifa$="s"thengosub498:goto488
- 482 ifa$="e"then68
- 483 ifa$="v"thengoto500
- 484 ifa$="r"thengosub498:goto493
- 486 gosub602:goto476
- 488 input" [153]scratch file name [158][146]";dr$:ifdr$=d$then462
- 490 open15,8,15:open5,8,5,"0:"+dr$+",s,r":gosub414:ifet=8then462
- 492 close5:print#15,"s0:"+dr$:close15:goto462
- 493 input" [153]rename old file [158][146]";dr$:ifdr$=d$then462
- 494 input" [153] to new file [146][158]";mr$:ifmr$=d$then462
- 495 open15,8,15:open5,8,5,"0:"+dr$+",s,r":gosub414:ifet=8then462
- 496 close5:print#15,"r0:"+mr$+"="+dr$:open5,8,5:gosub414:ifet=8then462
- 497 close5:close15:goto462
- 498 print"[147][153] enter file names exactly as shown"
- 499 print" on the directory, ex:[158] df] mail list[158]":@"$0:*=s":return
- 500 print"[147]":@"$":print"[153]validate this disk? y[146][153]es or n[146][153]o":gosub30
- 502 ifa$<>"y"then462
- 504 @"v0":goto462
- 506 :
- 600 fore=0to24:poke54272+e,0:next:poke54296,15:return
- 602 poke54277,58:poke54278,16:poke54273,35:poke54272,134
- 604 poke54276,33:fore=1to100:next:poke54276,16:return
-