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

Kenneth Brody kenbrody at spamcop.net
Tue Feb 15 05:43:31 PST 2011


On 2/14/2011 4:28 PM, Boaz Bezborodko wrote:
> On 2/14/2011 4:11 PM, Kenneth Brody wrote:
>> On 2/14/2011 3:27 PM, Boaz Bezborodko wrote:
>> [...]
>>>> Can you show the one that will actually work with 1 and 2 (but not 3)?
>>>> (And which won't give an error that "ImpData" isn't defined anywhere,
>>>> rather than your "caltag" error?)
>>>
>>> Sorry, I copied to the bottom of the editor's screen.
>>
>> Why not just attach the file, and eliminate the transcription errors?
>>
>>> What I did to test it out was to comment out 'caltag(4) and then add,
>>> one at
>>> a time, the lines with 'caltag(1)' 'caltag(2)' and 'caltag(3)'. I
>>> would not
>>> get syntax errors when compiling 1 or 1 and 2. But as soon as I added
>>> 3 I
>>> would get the error.
>>>
>>>
>>> Here is the complete file:
>> [...]
>>
>> Hint 1:
>>
>>      What would happen if, on line 23, you had this instead?
>>
>>          If:  zz ne "Dropship Vendor Notification Report"
>>
>> Hint 2:
>>
>>      Ybbx ng yvar guvegl guerr.
>>
>
> So because I didn't mention 'caltag(4)' on a THEN line Filepro considers
> it a syntax error?

Not quite.  Because the highest field you ever referenced on a "then" line 
was "caltag(2)" meant that there was no "caltag(4)" available.

> I put in a line with a comment :
> ' caltag(4).
>
> Even though caltag(4) shouldn't be considered part of a program because
> it is commented out, this allows it to pass the compiler syntax check.
> That doesn't really make any sense.

That's a bug, because it shouldn't treat that as a reference to caltag(4) 
because it's in a comment.  However, it's been kept due to the fact that 
there may be code out there that depends on it.  (And it's basically harmless.)

>  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.

>  But word
> that should not be considered part of the program is considered a valid
> syntax.  Mention the invalid syntax in a commented part of the program
> on a THEN line and everything then works.

What's the "invalid syntax" that you mentioned in the comment?

> 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?

-- 
Kenneth Brody


More information about the Filepro-list mailing list