I'm getting a syntax error with IMPORT...Why?

Boaz Bezborodko boaz at mirrotek.com
Wed Feb 16 11:18:44 PST 2011



On 2/15/2011 8:43 AM, Kenneth Brody wrote:
> On 2/14/2011 4:28 PM, Boaz Bezborodko wrote:
>
>>  A perfectly allowable syntax--a
>> part of a file array created by IMPORT--is considered invalid.
>
> Well, it could wait until runtime and give you an error there, like it 
> would if you tried to reference the 4th element of a 2-element array, 
> but I don't think you would find that preferable.
>

Why "Syntax error"?  Why not "Undefined Variable" or "Array out of 
bounds"?  Both are more accurate and something that Filepro would know 
in order to determine whether or not to give the error.  It would also 
tell the programmer what type of error Filepro actually found.

Regarding IMPORT or a regular array then an array-out-of-range is 
something that could still happen with a programming error.  It's 
happened to me a few times.

>> I further changed the commented part to 'caltag(8) and everything less
>> than 9 is considered acceptable so Filepro looks for the largest
>> instance of the IMPORT name on a THEN line to determine what is valid.
>> Given that it is not uncommon to use an imported field only an IF line
>> and that I have already run across this at least once before (I resolved
>> it without knowing at the time what I did), shouldn't this important
>> fact be listed in the manual for the IMPORT command?
>
> If you only referred to "zz" on the "if" line, how would you expect 
> filePro to act?
>

It tells me there is a Syntax Error...But an "undefined variable" (or 
some-such) error would be more accurate since the syntax is actually 
correct.  I just haven't yet defined the variable.


More information about the Filepro-list mailing list