mid statement

Brian K. White brian at aljex.com
Thu Nov 17 17:49:58 PST 2005


----- Original Message ----- 
From: "Fairlight" <fairlite at fairlite.com>
To: <filepro-list at lists.celestial.com>
Sent: Thursday, November 17, 2005 7:45 PM
Subject: Re: mid statement


> On Thu, Nov 17, 2005 at 04:13:43PM -0800, Todd, the prominent pundit,
> witicized:
>> SCO5.0.7
>> filePro 5.0.14R4
>>
>>   Am I missing something obvious or is the following not allowed. I am
>> getting a syntax error on the mid statement:
>>
>> 
>>  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>>         ¦
>> If:                                                                   ¦
>>         Then: lookup dtl = macswodtl  r=free  -e
>> 
>>  2  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
>>  -
>>         ¦
>> If:                                                                   ¦
>>         Then: copy dtl
>> 
>>  3  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
>>  -
>>         ¦
>> If:                                                                   ¦
>>         Then: dtl[1] = "WC80597"
>> 
>>  4  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
>>  -
>>         ¦ If: ' SPECIAL KEY, W/O# & PART NUMBER
>>         Then: mid(dtl[30],"1","7") = "WC80597"
>>
>> *** A filePro Error Has Occurred ***
>>
>> Line Number: 4
>>
>> mid(dtl[30],"1","7") = "WC80597"
>>      ^
>> Process contains a syntax error at position indicated.
>>
>> Thanks for your help.
>
> Shouldn't that be dtl(30) using parens rather than brackets?  This is a
> lookup, not an array.  I've never heard they were interchangeable on
> lookup aliases.
>
> Incidentally, I would personally make sure line 2 has a failure test of:
>
> IF:  not dtl
> THEN:  'handle error condition here

It's a lookup free and he used -e.
Line 2 would never be reached if it couldn't create a free record.
You may also be implying to change the -e to -n but I think getting a big 
nasty error and halting everything in the event of a failure to lokup free 
is entirely sensible.

Brian K. White  --  brian at aljex.com  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro  BBx    Linux  SCO  FreeBSD    #callahans  Satriani  Filk!



More information about the Filepro-list mailing list