Syntax error... in the wrong place
Brian K. White
brian at aljex.com
Fri Mar 1 13:52:49 PST 2013
On 3/1/2013 3:03 PM, Jay Ashworth wrote:
> ----- Original Message -----
>> From: "Jay Ashworth" <jra at baylink.com>
>
>> Ah... second-class objects. Nice. Ok. Thanks.
>
> So I wrote the copy and convert statements by hand, and now I'm getting
> the syntax error:
>
> """
> import ascii old=(fn) r=^J f=|
> ^
> Merge name incompatibility.
> Word processor or spreadsheet merge has been given two different names.
> """
>
> on line 25, the *second* of those calls I make. Can you not call import
> twice on the same file in the same table?
You can definitely execute the line multiple times but I think not
define it multiple times. Don't have two import lines. Have one import
line and use gosub or goto to execute it multiple times.
I would put the import in a gosub, and then gosub it once in @once (I
think your version of fp supports @once, if not, use @menu) and then
again near the top of the table.
---tof---
gosub getpdv
1 = pdv(1)
end
@once
fn(128,,g) = @pm
gosub getpdv
end
getpdv: ' pipe delimited values
import ascii pdv=(fn{"") f=|
end
---eof---
Or, instead of a gosub, have just the one statement in the body,
followed by a test for a special value only found in a header like
getln: import ...
if: "|"{old(2){"|" eq "|First Name|"
then: goto getln
I don't like this because it performs the test on every single input
line needlessly, but one advantage is it doesn't care if the sender
includes the header or not, it always does the right thing either way.
Also if you're version doesn't have @once, if your using clerk you can
use @menu instead. for report instead of clerk I don't know, just do the
regular test in the main body instead of the gosub I guess. I think 4.8
has @once though. It definitely has @done and I thought they came
together, though my help files claim @once is 5.0.
You don't need r=^J (I didn't know that was even valid vs r=\n), it's
already the default.
--
bkw
More information about the Filepro-list
mailing list