mid statement

Fairlight fairlite at fairlite.com
Thu Nov 17 16:45:10 PST 2005


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:
> 
> 1  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ¦ 
> 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

mark->
-- 
There is no "I" in TEAM.
This would be the primary reason I've chosen not to join one.


More information about the Filepro-list mailing list