This is an endeavor as noble as it is futile!
INSTR
is a feature found in Commodore BASIC 3.5 (Commodore-264 series: C16, C116, Plus/4), and Commodore BASIC 7.0 (C128). As I understand it, only the first two arguments are required (source-string and pattern, respectively), and the third argument (start position) is optional.
(In Commodore BASIC, a missing value often defaults to 0
. E.g., we may write “10 GOTO
” in order to jump to line #0.)
Apparently, it is also found in Commodore BASIC 4.2 (CBM 8096, CBM 8296), but here it comes with 4 arguments: pattern, variable/source-string, start position, search mode.
Search modes are: 0 = matching, left to right, 1 = difference, left to right, 2 = matching, right to left, 4 = difference, right to left. (Meaning, we can search either for matching strings or differences and this either left-to-right or in reverse order.)
Compare: BASIC – C64-Wiki
[Note/edit: This may well be where the confusion about the order of arguments originates, assuming that the 4th argument, search mode, is optional, as well, and defaults to 0
, which is “normal” operations. Notably, the order in BASIC 4.2 syntax would then be: pattern, source-string, start position.]
Commodore BASIC 4+ (CBM II series, CBM 500/600/700) has INSTR
as well, but this seems to follow the 2/3 arguments syntax of BASIC 3.5 and 7.0.
INSTR
is definitely not found on the original PET/CBM series (BASIC 1 (or 2), 2 (or 3), 4.0) or on the VIC-20 or C64 (BASIC V. 2.0).