have defined the following function:
Code: Select all
{ check entry of alpha string variables }
function alphachk( string alphavar, alphlen, string tail );
{ alphavar: the actual string to be checked }
{ alphlen: length of first consecutive part for the field, e.g. A-G is 7 }
{ tail: the last characters in the valid string }
alphaentry = alphabet[1:alphlen]; { string of acceptable values }
alphaentry = concat( strip(alphaentry), strip(tail) );
totlen = length( strip(alphaentry) );
aok = 0; { aok = 0 - string is bad, aok = 1 - string is good }
alphsize = length( strip(alphavar) );
if alphsize then
{ check for "?" as only character }
aok = (alphavar[1:1] = "?" & alphsize = 1);
if !aok then { if not a single "?", check string }
aok = 1; { now assume string is good until we know otherwise }
i = 1; { i is position in string of acceptable values }
x = 1; { x is position in input string }
{ loop while the string is still good and there are more letters }
while aok & x <= alphsize do
aok = pos( alphavar[x:1], alphaentry[i:totlen-i+1] );
if aok then { letter is acceptable }
i = i + aok; { increment i to position after letter in string of acceptable values }
x = x + 1 { increment x to next letter in input string }
endif;
enddo;
endif;
endif;
alphachk = (!aok); { alphachk = 0 - if string is good, = 1 - if string is bad }
end;
"RROR: Invalid symbol name near line 389 in GLOBAL procedure
ERROR: Single variable - cannot have subscript (unexpected left parenthesis) near line 1 in V217 procedure
ERROR: Single variable - cannot have subscript (unexpected left parenthesis) near line 1 in V243 procedure"
In the GLOBAL, I have the following:
numeric totlen, aok, alphsize, xchild, nextmem, col, xwoman, line, xcrop, xfarmer, xplots, alphachk;
string wothresp, vcc;
string notalpha, alphabet, alphaentry;
Could someone help me debug this please?
Thanks