File: nl.the

package info (click to toggle)
the 3.1-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 4,500 kB
  • ctags: 5,421
  • sloc: ansic: 66,327; sh: 2,745; makefile: 526
file content (32 lines) | stat: -rw-r--r-- 902 bytes parent folder | download | duplicates (6)
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
/*
 * This macro displays a popup menu showing all lines in the file that are named
 * as a result of a SET POINT command. When a line is selected, that line becomes current.
 */
Trace o
lf = D2c(10)
'extract /line/point *'
If point.0 = 0 Then Call Abort 'No named lines exist'
line = ''
max_line = 0
max_name = 0
save_line = line.1
Do i = 1 To point.0
   If Length( Word( point.i, 1 ) ) > max_line Then max_line = Length( Word( point.i, 1 ) )
   If Length( Word( point.i, 2 ) ) > max_name Then max_name = Length( Word( point.i, 2 ) )
   ':'Word( point.i, 1 )
   'extract /curline'
   point.i = point.i curline.3
End
':'save_line
Do i = 1 To point.0
   line = line || Right( Word( point.i, 1 ), max_line ) Left( Word( point.i, 2 ), max_name) Subword( point.i, 3 ) || lf
End
'popup centre' lf || line
idx = popup.2
If idx \= 0 Then ':'Word( point.idx, 1 )
Return

Abort:
Parse Arg msg
'emsg' msg
exit 0