home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / programs / comms_networking / irclient / !IRClient / Scripts / Modules / Help / !Module (.txt) next >
Encoding:
RISC OS BBC BASIC V Source  |  1997-03-20  |  5.1 KB  |  196 lines

  1.  >HelpLib
  2.  Used for Help on IRC 
  3.  Justin Fletcher
  4.  07 Aug 1996 - JF: Started :-)                      v1.00
  5.  10 Aug 1996 - JF: Bug fixes for overloads not passing on
  6.  28 Sep 1996 - JF: Modified for new dir structure   v1.01
  7.  0,"This is an IRClient script and cannot be run."
  8. InitialiseModule
  9.  Load the X-Files module
  10. StartupStatus("Initialising Help...")
  11. ("RMEnsure X-Files 0.55 RMLoad "+magrathea_mods$+".Help.X-Files")
  12. ("If ""<File$Type_B23>"" = """" Then IconSprites "+magrathea_mods$+".Help.Data.!Sprites")
  13. ("If ""<File$Type_B23>"" = """" Then Set File$Type_B23 X-File")
  14.  Initialise various path variables
  15. +help_base$=magrathea_mods$+".Help.Data"
  16. help_file$="Index"
  17. help_name$="Index"
  18.  Pass on to the next module
  19.  Give ourselves a sensible name
  20. Overload_ScriptInfo(num)
  21.  ret$
  22.  num=0 
  23.  ret$="Help v1.01 (Gerph)"
  24.  ret$=
  25. @(num-1)
  26. !    =ret$
  27.  Overload_DisplaySelected : A display has been selected
  28.  only displays with ## prefixes will be passed here
  29. Overload_DisplaySelected(display$)
  30.  display$="##Help##" 
  31. SelectHelp
  32. @(display$)
  33.  Overload_UserLine : Process a users input
  34. Overload_UserLine(str$)
  35.  SendingToDisplay$="##Help##" 
  36. Help_UserLine(str$)
  37. @(str$)
  38.  Overload_UnknownCommand : Process an unknown command
  39. Overload_UnknownCommand(command$,str$)
  40.  command$="HELP" 
  41. DoHelp(str$)
  42. @(command$,str$)
  43. SelectHelp
  44. SetInputTitle("Getting help about IRClient and IRC")
  45. SetFocus("##Help##")
  46.  help_file$<>"" 
  47. C/    
  48. SetPreInput("Help> ("+help_name$+") ")
  49. SetPreInput("Help> ")
  50. SetDisplayForRecall("##Help##")
  51. H"  SendingToDisplay$="##Help##"
  52.  Process the /help command to give a window and get help
  53. DoHelp(str$)
  54.  in,line$,obj,links,hline$,in,name,col
  55.  str$<>"" 
  56.  help_file$=str$
  57.  Make a nicely formatted name
  58. help_name$=help_file$
  59. help_name$,".")<>0
  60. US help_name$=
  61. help_name$,
  62. help_name$,".")-1)+" "+
  63. help_name$,
  64. help_name$,".")+1)
  65.  MID$(help_name$,INSTR(help_name$,"."))=" "
  66. Capitalise(
  67. help_name$,6))=" INDEX" 
  68. Y, help_name$=
  69. help_name$,
  70. (help_name$)-6)
  71. NewDisplay("##Help##",40,"IRClient Help",0)
  72. SelectHelp
  73.  Find the file and deal with directories
  74.  "OS_File",20,help_base$+"."+help_file$ 
  75.  obj=2 
  76.  obj=3 
  77.  "OS_File",20,help_base$+"."+help_file$+".Index" 
  78.  obj=1 
  79. d$  help_file$=help_file$+".Index"
  80.  obj<>1 
  81. DisplayWarning("Page '"+help_file$+"' could not be found","##Help##")
  82. Display("","","##Help##")
  83. l  a$="--- "+help_name$+" ---"
  84. (a$),"-")+a$
  85. Display(a$,"","##Help##")
  86.  links=0
  87.  hline$=""
  88. r$ in=
  89. (help_base$+"."+help_file$)
  90.  line$<>":END"
  91.   line$=
  92. line$,1)=":" 
  93.  line$<>":END" 
  94.     line$=
  95. line$,2)
  96. line$,1) 
  97.      
  98. z"      
  99.  A Link to another page
  100.       links=links+1
  101.       line$=
  102. line$,2)
  103. }%      name$=
  104. line$,
  105. line$,">")-1)
  106.       line$=
  107. (links)
  108. 1      line$=
  109. (line$)," ")+line$+". "+name$
  110.       
  111.  hline$="" 
  112.        hline$=line$
  113.       
  114.        col=
  115. (hline$)/20
  116.        
  117.  col<2 
  118. <        hline$=hline$+
  119. (20*(col+1))-
  120. (hline$)," ")+line$
  121.        
  122. *        
  123. Display(hline$,"","##Help##")
  124.         hline$=line$
  125.        
  126.       
  127.         
  128.  hline$<>"" 
  129. &    
  130. Display(hline$,"","##Help##")
  131.     hline$=""
  132. Display(line$,"","##Help##")
  133.  hline$<>"" 
  134. Display(hline$,"","##Help##")
  135.  Something entered whilst ##Help## is current window
  136. Help_UserLine(str$)
  137. (str$)<>0 
  138.  Option from little menu thingy
  139.  num=
  140. (str$)
  141.  links=0
  142.  page$=""
  143. $ in=
  144. (help_base$+"."+help_file$)
  145.  line$=""
  146.  line$<>":END"
  147.   line$=
  148. line$,1)=":" 
  149.  line$<>":END" 
  150.     line$=
  151. line$,2)
  152. line$,1) 
  153.      
  154. "      
  155.  A Link to another page
  156.       links=links+1
  157.       
  158.  links=num 
  159.        line$=
  160. line$,2)
  161. &       page$=
  162. line$,
  163. line$,">")+1)
  164.       
  165.         
  166.  page$="" 
  167. DisplayWarning("There is no link to option '"+str$+"'","##Help##")
  168. 0  help_file$=
  169. pathname(help_file$)+"."+page$
  170. help_file$,1)="." 
  171.     help_file$=
  172. help_file$,2)
  173. DoHelp(help_file$)
  174.  str$="." 
  175.  str$="" 
  176.  Go up an entry
  177. Capitalise(
  178. help_file$,6))=".INDEX" 
  179. ;   help_file$=
  180. pathname(
  181. pathname(help_file$))+".Index"
  182.  help_file$=".Index" 
  183.     help_file$="Index"
  184. DoHelp(help_file$)
  185. Capitalise(help_file$)="INDEX" 
  186.      
  187. KillDisplay("##Help##")
  188. SelectNoFocus
  189. 1    help_file$=
  190. pathname(help_file$)+".Index"
  191.  help_file$=".Index" 
  192.      help_file$="Index"
  193.         
  194. DoHelp(help_file$)
  195. DisplayWarning("I'm sorry but Help is not currently supported like this","##Help##")
  196.