home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / desktop / a / asp / !ASP / BasicLib (.txt) < prev    next >
Encoding:
RISC OS BBC BASIC V Source  |  1990-07-27  |  2.1 KB  |  84 lines

  1.  > <ASP$Dir>.BasicLib
  2.  Dummy PROCs in case user does not supply!
  3. ASP_SetUp
  4. ASP_GoingDormant
  5.  main poll routine: reason=FNASP_Poll(buffer) replaces SYS"Wimp_Poll",,buffer TO reason
  6. ASP_Poll(buffer)
  7.  reason,temp
  8.  "Wimp_Poll",,buffer 
  9.  reason
  10. ASP_Icon$=""
  11. ASP_esg=-1
  12. ASP_Status=0
  13.  reason 
  14.  17,18
  15.  buffer!16 
  16.  ASP_SetMeUp:ASP_Active=
  17. ASP_SetUp:reason=0
  18.  ASP_GoingDormant:ASP_Active=
  19. ASP_GoingDormant:reason=0
  20.  ASP_IconSelected
  21.        ASP_Icon$=$(buffer+20)
  22.       temp=
  23. ASP_Icon$,".")
  24. &      ASP_esg=
  25. ASP_Icon$,temp-1)
  26. &      ASP_Icon$=
  27. ASP_Icon$,temp+1)
  28.       reason=0
  29.  ASP_SwitchPress:ASP_Status=
  30. $(window_buffer+20)
  31. =reason
  32.  Translates an OS string into a BASIC string expanding variables
  33. ASP_GSTrans(a$)
  34.  c$,ptr,len
  35. 255," ")
  36. "OS_GSTrans",a$,c$,255 
  37.  ,ptr,len
  38. ptr?len=13
  39. t    =$ptr
  40.  Sends an ASP command string and returns the response
  41. ASP_SendCommand(message$,buffer)
  42.  a$,ref,reason
  43.  ASP_Active 
  44.  ASP_DormantError,"!ASP dormant - can't send "+message$
  45. ASP_GSTrans("<ASP$Task_id>")
  46. !!buffer=((25+
  47. message$)
  48.  4)*4
  49. buffer!12=0
  50. buffer!16=ASP_Command
  51. $(buffer+20) = message$
  52. "Wimp_SendMessage",18,buffer,
  53. ref=buffer!8
  54. task_id=buffer!4
  55. "Wimp_Poll",,buffer 
  56.  reason
  57.  (reason>=17 
  58.  reason<=18 
  59.  buffer!12=ref 
  60.  buffer!4<>task_id) 
  61.  (reason=19 
  62.  buffer!8=ref)
  63.  reason=19 
  64.  ASP_NoResponseError,"No response from !ASP to "+message$
  65. =$(buffer+20)
  66.  initialisation routine - must be called first
  67. ASP_Init
  68. ASP_message=&81500
  69. ASP_Command=ASP_message+5
  70. ASP_Response=ASP_message+6
  71. ASP_SetMeUp=ASP_message+2
  72. d"ASP_GoingDormant=ASP_message+3
  73. n"ASP_IconSelected=ASP_message+4
  74. !ASP_SwitchPress=ASP_message+7
  75.  ASP_DormantError=ASP_message
  76. %ASP_NoResponseError=ASP_message+1
  77. ASP_Active=
  78. ASP_ActiveChanged=
  79. ASP_Status=0
  80.  Returns a control character terminated string from a buffer
  81. ASP_GetString(address)
  82. ?address>31 a$=a$+
  83. (?address):address+=1:
  84.