[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Problem with Valentina 1.8 PPC MacPerl glue code



At 21:11 +0200 2000.07.17, Philippe de Rochambeau wrote:
>I have been trying to run the following script using Valentina 1.8
>(www.paradigmasoft.com) gluecode generated by cpan-mac, without success:

You mean gluemac, not cpan-mac, I hope.


>$n->make(new => 'base_object', with_properties => {name => 'Customer'},
>at => {current_record => 'end', database => $theDB });
>die $^E if $^E;


>Process("Valentina (PPC)").SendAE "core,crel,prdt:{pnam:“Customer”},
>kocl:type(VLbo), insh:{kpos:“end”, VLdb:“Customers”}"


>Process("Valentina (PPC)").SendAE "core,crel,kocl:type(VLbo),
>prdt:{pnam:“Customer”}, insh:insl{kobj:obj {form:name, want:type(VLdb),
>seld:“Customers db”, from:'null'()}, kpos:end }, &subj:'null'()"


OK, your location stuff is what appears to be messed up.  Let's for
sanity's sake compare:

MacPerl:
  core\crel
    kocl:type(VLbo),
    prdt:{pnam:"Customer"},
    insh:{
      kpos:"end",
      VLdb:"Customers"
    }

AppleScript:
  core\crel
    kocl:type(VLbo),
    prdt:{pnam:"Customer"},
    insh:insl{
      kpos:end,
      kobj:obj {
        form:name,
        want:type(VLdb),
        seld:"Customers db",
        from:'null'()
      }
    }

I removed the &subj part which doesn't matter, converted quote marks to
their ASCII versions, and reorganized a few things (order doesn't matter).
There are two differences.  One is kpos is '"end"' in one and 'end' in the
other.  The other is that a VLdb parameter is passed instead of a kobj
parameter.

This is exactly right, according to how you constructed them.  You told the
method that "end" is a string, and that the second parameter is "database".
There is a section on insertion location records in the Mac::Glue POD that
describes the location() function that is used to get around this stuff.
Note in the AppleScript version you see "insl{...}".  That is your
insertion location record, and requires special code to construct.  On
first guess, without testing, I would try:

   use Mac::Glue ':all';

   # ...

   $n->make(new => 'base_object',
      with_properties => { name => 'Customer' },
      at => location(end => $theDB)
   );

That should do it, and looks right according to the Mac::Glue docs.  Let me
know how it works.

--
Chris Nandor       |     pudge@pobox.com      |     http://pudge.net/
Andover.Net        | chris.nandor@andover.net | http://slashcode.com/

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org