Definitely a BASIC dialect. Fairly old code, so there's nothing too obscure. An IF ... THEN is an IF ... THEN.
The code between the lines numbered 5
and 90
(lines 10 through 38 in your pastebin) is your main processing loop. The GOSUBs at lines 5000
and 9000
are subroutines called from the main loop.
A couple of the more arcane features that I see here, irrespective of the dialect:
- OCONV is a formatting function; think of it like sprintf()
- the PRINT statements appear to be inserting a space before each nonblank line; old-style line printers often interpreted the first character of a print line as a control character to advance to a new page, e.g.; a space means "just print the line"
Update
Something I missed on the first reading: the bracket syntax is performing a substring operation. So, for instance, the code at line 12 of your pastebin,
IF R[26,2]='20' THEN GOSUB 9000;GOTO 5
is comparing characters 26 and 27 of the buffer (associated with the READ
at line 5
) to the string '20'
. In the next line, R[26,2]#30
, the #
is a not-equal-to operator.
Update
I'm with you, not all the formatting strings are explained in the doc. But I suspect that Z
, 9
, and ,
work like they do in COBOL.
Z
: suppress leading zeroes: print space if the corresponding digit and all digits to the left are zero, the digit otherwise,
: print a comma if there is a nonblank/nonzero digit to the left, space otherwise9
: print the corresponding digit, even if it's zero
So with a format string of MDZZ,ZZ9
:
0 prints as 0
12 prints as 12
123 prints as 123
1234 prints as 1,234
12345 prints as 12,345
Update
The syntax of the OPEN
statement in your pastebin does not exactly match the documentation for Caché MultiValue Basic nor for UniBasic. However, I can surmise that part of the string '1/1/FSNC0128S'
represents channel number 1, and it's this same channel number that appears in
5 READ R FROM 1 ELSE GOTO 90
Think of a channel number like a filehandle in Perl or a C file descriptor.
I would work under the assumption that the other 1
in the string is some sort of access modifier (although the FOR RANDOM IO
would seem to contradict), and just focus on locating the file FSNC0128S
.