/usr/share/THE/total.the is in the 3.3~rc1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | /*
$Id: total.the,v 1.2 2004/08/07 04:28:33 mark Exp $
*/
/***********************************************************************/
/* Description: REXX macro to sum numbers in a marked block. */
/* Syntax: total */
/* Notes: This macro will sum the numbers in the marked block */
/* and insert a new line with the total at the end of the */
/* block. */
/***********************************************************************/
Trace o
Numeric Digits 20 /* to make really sure that we don't get overflow */
'EXTRACT /BLOCK/FILENAME/FPATH/'
If block.0 = 1 Then Do
'EMSG No Marked block'
Return
End
If block.1 \= 'BOX' & block.1 \= 'COLUMN' Then Do
'EMSG No Marked BOX or COLUMN block'
Return
End
current_file = fpath.1||filename.1
If current_file \= block.6 Then Do
'EMSG Marked block not in current file'
Return
End
Do i = block.2 To block.4
'NOMSG :'||i
If rc = 0 Then Leave
End
tot. = 0
Do Forever
'EXTRACT /CURLINE/LINE/EOF'
If line.1 > block.4 Then Leave
If eof.1 = 'YES' Then Leave
num = Substr(curline.3,block.3,block.5-block.3+1)
Do i = 1 To Words(num)
If Datatype(Word(num,i),'NUM') Then tot.i = tot.i + Word(num,i)
End
if Words(num) > tot.0 Then tot.0 = Words(num)
'N'
End
'U'
line = ''
Do i = 1 To tot.0
line = line tot.i
End
/*
* Determine correct right alignment
*/
len = Length(line)
spaces = block.5-len
If spaces > 0 Then line = Copies(' ',spaces)line
'i' line
'N'
Return
|