home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / programs / comms_networking / hearsay / !Hearsay / Libraries / General (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1996-07-04  |  3KB  |  151 lines

  1.  > General functions library
  2.  Chris Rutter, 1995
  3. ct(address%)
  4.  string$
  5.  ?address%>31 
  6. (string$)<255
  7.  string$+=
  8. (?address%)
  9.  address%+=1
  10. =string$
  11. msg(token$)
  12. ael("msg")
  13.  message_found%
  14.  debugmode% 
  15. verbose 
  16. debug_message("Request for message "+token$)
  17.  "XMessageTrans_Lookup",message_desc%,token$,message_buff%,256 
  18.  ,,,message_size%;message_found%
  19.  message_found% 
  20.  $message_buff%="" 
  21.  message_buff%?message_size%=13
  22. ct(message_buff%)
  23. msg_parse(msg_string$)
  24.  begin%,end%,message$,length%
  25. msg_string$,"{")<
  26. msg_string$,"}")
  27.  begin%=
  28. msg_string$,"{")+1
  29.  end%=
  30. msg_string$,"}")-1
  31.  length%=1+end%-begin%
  32. * message$=
  33. msg_string$,begin%,length%)
  34. message$,"$") 
  35.  message$=
  36. (message$) 
  37.  message$=
  38. (message$))
  39. E msg_string$=
  40. msg_string$,begin%-2)+message$+
  41. msg_string$,end%+2)
  42. msg_string$,"<")<
  43. msg_string$,">") 
  44. msg_string$,
  45. msg_string$,">")-1,1)<>"-"
  46.  begin%=
  47. msg_string$,"<")+1
  48.  end%=
  49. msg_string$,">")-1
  50.  length%=1+end%-begin%
  51. msg_string$,end%,1)<>"-" 
  52. $1  message$=
  53. msg_string$,begin%,length%))
  54. %F  msg_string$=
  55. msg_string$,begin%-2)+message$+
  56. msg_string$,end%+2)
  57. =msg_string$
  58. error
  59. $+" @ "+
  60. )+" ["+error$+"]"
  61. hexadecimal(value%)
  62. =STR$(value%)
  63. /!="0x"+
  64. lower_case(
  65. ~(value%))
  66. lower_case(string$)
  67. (string$)=0 
  68.  =string$
  69.  dummy%
  70.  dummy%=1 
  71. (string$)
  72. string$,dummy%,1))>=
  73. ("A") 
  74. string$,dummy%,1))<=
  75. ("Z") 
  76. string$,dummy%)=
  77. string$,dummy%,1))+32)
  78.  dummy%
  79. =string$
  80.  char%
  81.  debugmode% 
  82.  old_error$=error$
  83. error$,".")=0 
  84.  error$=""
  85.  char%=
  86. (error$) 
  87. error$,char%,1)="." 
  88.  error$=
  89. error$,char%-1):char%=0:
  90.  debugmode% 
  91.  old_char%=char%
  92.  char%
  93.  debugmode% 
  94. debug_message("] {MID$(old_error$,old_char%+1)}")
  95. ael(string$)
  96.  debugmode% 
  97. debug_message("{string$} [")
  98. (error$)+
  99. (string$)+1<210 
  100.  error$+="."+string$
  101. notify(text$)
  102. text$,1)="#" 
  103.  text$=
  104. text$,2))
  105. text$=
  106. msg_parse(text$)
  107.  debugmode% 
  108. debug_message(text$)
  109. !error%=0
  110. $(error%+4)=text$
  111.  "Wimp_ReportError",error%,1 
  112.  (1<<4),"Warning from "+taskname_short$
  113. blank_poll
  114.  action%
  115.  "Wimp_PollIdle",%11100011100101110011,wbk2%,20 
  116.  action%
  117. ct_text(block%,item%)
  118.  item%=0 
  119. ct(block%)
  120.  control%
  121.  ?block%<32 
  122.  control%+=1
  123.  block%+=1
  124.  control%=item%
  125. ct(block%)
  126. load_sprites
  127.  file$,size%
  128. read_mode_variables
  129. e!file$="<Hearsay$Dir>.Sprites"
  130.  xeig%<2 
  131.  yeig%<2 
  132.  file$+="22"
  133.  "OS_File",5,file$ 
  134.  ,,,,size%
  135.  sprites% size%+4
  136.  "OS_File",255,file$,sprites%+4
  137. !sprites%=size%+4
  138. memory_needed%+=size%+4
  139. read_mode_variables
  140.  debugmode% 
  141. debug_message("Reading mode variables...")
  142.  xs%,ys%
  143.  "OS_ReadModeVariable",-1,4 
  144.  ,,xeig%
  145.  "OS_ReadModeVariable",-1,5 
  146.  ,,yeig%
  147.  "OS_ReadModeVariable",-1,11 
  148.  ,,xs%
  149.  "OS_ReadModeVariable",-1,12 
  150.  ,,ys%
  151.