home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1988 May / 64er_Magazin_88-05_1988_Markt__Technik_de_Side_A.d64 / mcc-dmo.inp (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  834b  |  24 lines

  1. 100 rem -------------------------------
  2. 101 rem -  basic simulation of input  -
  3. 102 rem - i: x (x-co-ord.) 0<x<41     -
  4. 103 rem -    y (y-co-ord.) 0<y<26     -
  5. 104 rem -    l (length)    0<l<42-x   -
  6. 105 rem -    in$           string     -
  7. 106 rem - o: in$           string     -
  8. 107 rem -------------------------------
  9. 108 ifx<1orx>40ory<1ory>25orl<1orx+l>41thenprint"?illegal quantity error";:end
  10. 109 ifpeek(157)>0thenprint"?illegal direct error";:end
  11. 110 in$=left$(in$+"                                        ",l):p=1
  12. 111 poke204,1
  13. 112 !p,x,y,in$:!p,x+p-1,y,""
  14. 113 poke204,0
  15. 114 !g,i$:ifi$=""goto114
  16. 115 ifi$=""thenifp<lthenp=p+1
  17. 116 ifi$="[157]"thenifp>1thenp=p-1
  18. 117 ifi$=chr$(20)thenifp>1thenin$=left$(in$,p-2)+right$(in$,l-p+1)+" ":p=p-1
  19. 118 ifi$=chr$(148)thenifp<lthenin$=left$(in$,p-1)+" "+mid$(in$,p,l-p)
  20. 119 ifi$=chr$(13)thenpoke204,1:!p,x,y,in$:return
  21. 120 ifi$<chr$(32)or(i$>chr$(127)andi$<chr$(160))then111
  22. 121 in$=left$(in$,p-1)+i$+right$(in$,l-p):ifp<lthenp=p+1
  23. 122 goto111
  24.