home *** CD-ROM | disk | FTP | other *** search
RISC OS BBC BASIC V Source | 1997-03-20 | 5.1 KB | 196 lines |
- >HelpLib
- Used for Help on IRC
- Justin Fletcher
- 07 Aug 1996 - JF: Started :-) v1.00
- 10 Aug 1996 - JF: Bug fixes for overloads not passing on
- 28 Sep 1996 - JF: Modified for new dir structure v1.01
- 0,"This is an IRClient script and cannot be run."
- InitialiseModule
- Load the X-Files module
- StartupStatus("Initialising Help...")
- ("RMEnsure X-Files 0.55 RMLoad "+magrathea_mods$+".Help.X-Files")
- ("If ""<File$Type_B23>"" = """" Then IconSprites "+magrathea_mods$+".Help.Data.!Sprites")
- ("If ""<File$Type_B23>"" = """" Then Set File$Type_B23 X-File")
- Initialise various path variables
- +help_base$=magrathea_mods$+".Help.Data"
- help_file$="Index"
- help_name$="Index"
- Pass on to the next module
- Give ourselves a sensible name
- Overload_ScriptInfo(num)
- ret$
- num=0
- ret$="Help v1.01 (Gerph)"
- ret$=
- @(num-1)
- ! =ret$
- Overload_DisplaySelected : A display has been selected
- only displays with ## prefixes will be passed here
- Overload_DisplaySelected(display$)
- display$="##Help##"
- SelectHelp
- @(display$)
- Overload_UserLine : Process a users input
- Overload_UserLine(str$)
- SendingToDisplay$="##Help##"
- Help_UserLine(str$)
- @(str$)
- Overload_UnknownCommand : Process an unknown command
- Overload_UnknownCommand(command$,str$)
- command$="HELP"
- DoHelp(str$)
- @(command$,str$)
- SelectHelp
- SetInputTitle("Getting help about IRClient and IRC")
- SetFocus("##Help##")
- help_file$<>""
- C/
- SetPreInput("Help> ("+help_name$+") ")
- SetPreInput("Help> ")
- SetDisplayForRecall("##Help##")
- H" SendingToDisplay$="##Help##"
- Process the /help command to give a window and get help
- DoHelp(str$)
- in,line$,obj,links,hline$,in,name,col
- str$<>""
- help_file$=str$
- Make a nicely formatted name
- help_name$=help_file$
- help_name$,".")<>0
- US help_name$=
- help_name$,
- help_name$,".")-1)+" "+
- help_name$,
- help_name$,".")+1)
- MID$(help_name$,INSTR(help_name$,"."))=" "
- Capitalise(
- help_name$,6))=" INDEX"
- Y, help_name$=
- help_name$,
- (help_name$)-6)
- NewDisplay("##Help##",40,"IRClient Help",0)
- SelectHelp
- Find the file and deal with directories
- "OS_File",20,help_base$+"."+help_file$
- obj=2
- obj=3
- "OS_File",20,help_base$+"."+help_file$+".Index"
- obj=1
- d$ help_file$=help_file$+".Index"
- obj<>1
- DisplayWarning("Page '"+help_file$+"' could not be found","##Help##")
- Display("","","##Help##")
- l a$="--- "+help_name$+" ---"
- (a$),"-")+a$
- Display(a$,"","##Help##")
- links=0
- hline$=""
- r$ in=
- (help_base$+"."+help_file$)
- line$<>":END"
- line$=
- line$,1)=":"
- line$<>":END"
- line$=
- line$,2)
- line$,1)
-
- z"
- A Link to another page
- links=links+1
- line$=
- line$,2)
- }% name$=
- line$,
- line$,">")-1)
- line$=
- (links)
- 1 line$=
- (line$)," ")+line$+". "+name$
-
- hline$=""
- hline$=line$
-
- col=
- (hline$)/20
-
- col<2
- < hline$=hline$+
- (20*(col+1))-
- (hline$)," ")+line$
-
- *
- Display(hline$,"","##Help##")
- hline$=line$
-
-
-
- hline$<>""
- &
- Display(hline$,"","##Help##")
- hline$=""
- Display(line$,"","##Help##")
- hline$<>""
- Display(hline$,"","##Help##")
- Something entered whilst ##Help## is current window
- Help_UserLine(str$)
- (str$)<>0
- Option from little menu thingy
- num=
- (str$)
- links=0
- page$=""
- $ in=
- (help_base$+"."+help_file$)
- line$=""
- line$<>":END"
- line$=
- line$,1)=":"
- line$<>":END"
- line$=
- line$,2)
- line$,1)
-
- "
- A Link to another page
- links=links+1
-
- links=num
- line$=
- line$,2)
- & page$=
- line$,
- line$,">")+1)
-
-
- page$=""
- DisplayWarning("There is no link to option '"+str$+"'","##Help##")
- 0 help_file$=
- pathname(help_file$)+"."+page$
- help_file$,1)="."
- help_file$=
- help_file$,2)
- DoHelp(help_file$)
- str$="."
- str$=""
- Go up an entry
- Capitalise(
- help_file$,6))=".INDEX"
- ; help_file$=
- pathname(
- pathname(help_file$))+".Index"
- help_file$=".Index"
- help_file$="Index"
- DoHelp(help_file$)
- Capitalise(help_file$)="INDEX"
-
- KillDisplay("##Help##")
- SelectNoFocus
- 1 help_file$=
- pathname(help_file$)+".Index"
- help_file$=".Index"
- help_file$="Index"
-
- DoHelp(help_file$)
- DisplayWarning("I'm sorry but Help is not currently supported like this","##Help##")
-