home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1993 March / 1993-03.d64 / xdemo (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  60 lines

  1. 10 if ll= 0 then ll=1:load"xinput",8,1
  2. 20 poke650,128:printchr$(14):printchr$(8)
  3. 30 xx=52232
  4. 40 print"[147]":poke53281,0:poke53280,0:poke646,1
  5. 50 sysxx,0,15:print"[216][201][206][208][213][212]"
  6. 60 sysxx,3,0:print"[216][201][206][208][213][212] is a replacement for the [194][193][211][201][195]
  7. 70 [153]:[153]"input command. right$t provides complete "
  8. 80 [153]:[153]"control over the input process..... "
  9. 90 [153]: [153]:[153]"e.g. what is your name "
  10. 100 [158]xx,13, 2:[153]"(NULL)ou may only use:"
  11. 110 [158]xx,15,3:[153]"(NULL)he uppercas/lowercase alphabet keys"
  12. 120 [158]xx,16,3:[153]"(NULL)he space bar"
  13. 130 [158]xx,18,0:[153]"(NULL)he usual editing & crsr keys are active"
  14. 140 al$[178]"azatn(NULL)  ":[141]520
  15. 150 [158]xx,10,23,15,n$
  16. 160 [143]-long
  17. 170 [153]"load(NULL)(NULL) ";n$;", note that (NULL)right$(NULL)(NULL)(NULL)(NULL) can"
  18. 180 [153]"handle strings of length upto 255":[153]"characters"
  19. 190 [153]:[153]"valnter a long string, (this time";
  20. 191 [153]" only the lowercase alphabets & numbers can be"
  21. 192 [153]" entered)"
  22. 200 [158]xx,20,0:[153]"(NULL)emember that crsr up, down left, rightwait keys and ";
  23. 210 [153]"and the insert & delete keyswait   are active"
  24. 220 al$[178]"az  09":[141]520
  25. 230 [158]xx,10,0,255,n1$
  26. 240 [153]"load(NULL)ou entered the following string:"
  27. 250 [153]n1$:[141]480
  28. 260 :
  29. 270 [143]-range
  30. 280 [153]"load(NULL)ou have full control over the charcters that can be entered"
  31. 290 [153]"e.g. enter a number in the exponent form"
  32. 300 [153]"(like -6.254 e+10)
  33. 310 print"[212]he following keys are active:"
  34. 320 print"  [206]umber keys
  35. 330 [153]"  (NULL)lus & minus keys
  36. 340 print"  [212]he alphabet 'e'
  37. 350 [153]"  (NULL)he decimal point
  38. 360 al$="09  ee-.++":gosub520
  39. 370 sysxx,16,0,15,n2$
  40. 380 sysxx,18,0 :print"[217]ou entered the following number:"
  41. 390 printn2$:gosub480
  42. 400 :
  43. 410 rem-final
  44. 420 print"[147][216][201][206][208][213][212] can also provide a default string"
  45. 430 print"[197]nter a string using only the space bar[146] & lowercase alphabet keys[146]"
  46. 440 al$="  az":gosub520
  47. 450 n3$="default string":  sysxx,09,5,30,n3$
  48. 460 sysxx,13,0:print"you entered the string":printn3$:gosub480
  49. 470 printchr$(142):printchr$(9):print"demo over":end
  50. 480 sysxx,23,8:print"press any key to go on":poke198,0:wait198,1:poke198,0
  51. 490 return
  52. 500 :
  53. 510 rem-include this subroutine in your own programs
  54. 520 al=len(al$):if(al and 1)= 1 thenprint"bad length for [216][201][206][208][213][212]":stop
  55. 530 for r= 1 to al
  56. 540 poke52940+r,asc(mid$(al$,r,1))
  57. 550 next
  58. 560 poke52940,al/2
  59. 570 return
  60.