@program helpsys.muf 1 1000 d i ( Internal help system (C) 2003 Alynna Trypnotk Release Terms: GNU GPL v2, http://www.gnu.org/licenses/gpl.html Use anywhere, dont remove credits, return improvements to alynna@animaltracks.net ) $author Alynna $version 1.01 $include $lib/alynna $include $cmd/lsedit $include $cmd/cp-mv $def HELP "$HELP" match $def LSEDIT "$cmd/lsedit" match lvar param : helpsys var count var linestore var item var function function ! ( If a topic, dump it as a topic ) HELP function @ "#" strcat propdir? if str "Help on: " function @ cat header tellme HELP function @ "#" strcat array_get_proplist atellme else ( dump an index ) str "Help on: " function @ cat header tellme function @ "/" smatch if "^GREEN^Indexes are listed in green^NORMAL^, ^YELLOW^Topics are listed in yellow.^NORMAL^" tellme "To view a topic or index, type +help " tellme "Indexes" header tellme else "^GREEN^Indexes are listed in green^NORMAL^, ^YELLOW^Topics are listed in yellow.^NORMAL^" tellme str "To view a topic or index, type +help " function @ "/" cat tellme "Indexes" header tellme then ( indexes ) -1 count ! "" linestore ! HELP function @ array_get_propdirs foreach item ! item @ "*#" smatch not if count @ 1 + count ! linestore @ str "^GREEN^" item @ tostr dup strlen 2 > if capitalize else toupper then 19 lj "^NORMAL^" cat strcat linestore ! count @ 4 % 3 = if linestore @ tellme "" linestore ! then then repeat count @ 4 % 3 < if linestore @ tellme "" linestore ! then "Topics" header tellme ( subtopics ) -1 count ! "" linestore ! HELP function @ array_get_propdirs foreach item ! item @ "*#" smatch if count @ 1 + count ! linestore @ str "^YELLOW^" item @ tostr "" "#" subst dup strlen 2 > if capitalize else toupper then 19 lj "^NORMAL^" cat strcat linestore ! count @ 4 % 3 = if linestore @ tellme "" linestore ! then then repeat count @ 4 % 3 < if linestore @ tellme "" linestore ! then then "Alynna's HELP system v1.0" footer tellme ; : addfile param @ not if str "34, Syntax error, 00, 00: Required, file name" cat "Help" pretty tellme exit then str "Preparing to edit file: " HELP name ":/" param @ cat tellme str "#" HELP int "=/" param @ cat LSEDIT call str "00, OK, 00, 00: " HELP name ":/" param @ cat "Help" pretty tellme ; : delfile var incompetance var aggression var dissatisfaction var dismissal var item var value param @ not if str "34, Syntax error, 00, 00: Required, file name" cat "Help" pretty tellme exit then HELP "/" param @ "#" strcat strcat getprop not if str "43, File not found, 00, 00: " param @ cat "Help" pretty tellme exit then HELP "/" param @ "#/" strcat strcat array_get_propvals foreach value ! item ! HELP "/" param @ "#/" item @ strcat strcat strcat remove_prop repeat HELP "/" param @ "#/" strcat strcat remove_prop str "01, Files scratched, 01, 00: " HELP name ":/" param @ cat "Help" pretty tellme ; : mvfile var src var tgt param @ not if str "35, Syntax error, 00, 00: Required, " command @ " file1=file2" cat "Help" pretty tellme exit then param @ "=" instr not if str "36, Syntax error, 00, 00: Required, " command @ " file1=file2" cat "Help" pretty tellme exit then param @ "=" split tgt ! src ! HELP src @ "#/" strcat HELP tgt @ "#/" strcat "$cmd/cp-mv" match "mv-prop" call str "02, Files moved, 01, 00: " HELP name ":/" param @ cat "Help" pretty tellme ; : main param ! command @ "*/add" smatch if addfile exit then command @ "*/ed" smatch if addfile exit then command @ "*/del" smatch if delfile exit then command @ "*/mv" smatch if mvfile exit then param @ not if "/" helpsys else param @ helpsys then ; . c q @act #0=+help;+help/add;+help/ed;+help/mv;+help/del