File: gtmhlpld.m

package info (click to toggle)
fis-gtm 7.1-006-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 32,908 kB
  • sloc: ansic: 344,906; asm: 5,184; csh: 4,859; sh: 2,000; awk: 294; makefile: 73; sed: 13
file content (59 lines) | stat: -rwxr-xr-x 1,720 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;								;
; Copyright (c) 2002-2017 Fidelity National Information		;
; Services, Inc. and/or its subsidiaries. All rights reserved.	;
;								;
;	This source code contains the intellectual property	;
;	of its copyright holder(s), and is made available	;
;	under a license.  If you do not know the terms of	;
;	the license, please stop and do not read further.	;
;								;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gtmload	;
	new (%zdebug)
	set %level=$zlevel
	set $ztrap=$select($data(%zdebug):"b",1:"zg %level:err")
	f  read "Help file > ",file  s x=$zsearch(file) q:file=""!(x'="")   d
 .		w !,"File does not exist, <CR> to quit.",!
 .		quit
	if file="" quit
	open file:(readonly)
	use file
	set ref="^HELP",incr=1,count=0,level=0,oldlevel=0,^HELP=""
	for  read line quit:$zeof  do
 .		set first=$extract(line)
 .		if first?1N!(first="-") do
 ..			if first?1N set level=first,oldlevel=first
 ..			else  set level=oldlevel+1
 ..			if level'>count set ref=$name(@ref,(level-1)*2)
 ..			set count=level
 ..			set:first?1N subtopic=$piece(line," ",2)
 ..			set:first="-" subtopic=$piece(line," ",1)
 ..			set ref=$name(@ref@("s"))
 ..			set ref=$name(@ref@($$UCASE(subtopic)))
 ..			set @ref=subtopic
 ..			set incr=1
 ..			quit
 .		else  do
 ..			set @ref@(incr)=line
 ..			set incr=incr+1
 ..			quit
 .		quit
	close file
 	quit
err	;
	set $ztrap=""
	u 0 w !,"Error in GT.M help load utility."
	set file="gtmhlpld.dmp"
	open file:newversion
	use file
	zshow "*"
	close file
	set $etrap="zgoto 0"
	zhalt 1
	;
UCASE(string)
	set lo="abcdefghijklmnopqrstuvwxyz"
	set up="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	quit $translate(string,lo,up)