home *** CD-ROM | disk | FTP | other *** search
- /*
- WordIndex.rexx
- */
- options results
- address PCALCFUN
-
- 'GetParam' 1
- filename = result
-
- 'GetParam' 2
- line_num = result
-
- 'GetParam' 3
- wordindex = result
-
- 'GetParam' 4
- num_words = result
-
- if ~open(file, filename, r) then
- finish("~~~~~~~")
-
- if ~datatype(wordindex, n ) then
- finish("~~~~~~~")
-
-
- if ~datatype( num_words, n ) then
- finish("~~~~~~~")
-
- count = 1
-
- do while count <= line_num
-
- if eof(file) then
- do
- call close(file)
- finish("~~~~~~~")
- end
-
- line = readln(file)
- count = count + 1
-
- end
-
- call close(file)
-
- if num_words = -1 then finish( subword( line, wordindex ))
- else finish( subword( line, wordindex, num_words ))
-
- finish: procedure
- do
- parse arg returnval
-
- 'CalcResult' returnval
- exit
- end
-