[VAPP] working with Valentina via Perl

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Jan 22 00:18:54 CST 2004


on 1/22/04 12:12 AM, Lloyd Butler at lbutler at on.pelmorex.com wrote:

> Ruslan,
> 
> I have installed and configured Mac::Glue for Perl under OS X and I have
> generated the Valentina glue file, which will give Perl access to the
> Applescript guts of Valentina.
> 
> I have a routine that queries the database and returns a cursor and then
> formats the result to text.
> Here is the main part of the code.
> 
> # Let's create a database object to work with
> $valObj = Mac::Glue->new('Valentina_Carbon') ;
> 
> $theDB = $valObj->obj(file => "$dbPath") ;
> $theDB = $valObj->open($theDB) ;
> 
> if (! $theDB) {
> return "Failed to open $dbPath : $MacError" ;
> }
> else {    
> $theCursor = $valObj->sql($theDB,select=>$theCommand) ;
> $recCount = $valObj->count($theCursor,each=>"record") ;
> $fieldCount = $valObj->count($theCursor,each=>"field") ;
> 
> @theData = $valObj->format($theCursor,using => $theFormat ,from =>
> 1,to => $recCount) ;
> 
> $valObj->delete($theCursor) ;
> }
> What I would like to do is figure out how to get at various properties of
> the cursor, like field names.
> 
> To do it in AS, it would be
> 
> set aField to name of field 1 of record 1 of theCursor
> 
> Any ideas how to do this using the model in Perl? I am still trying to get
> use to this sort of object model.

Lloyd, I am sorry, I am not helper here.

I don't know Perl absolutly.


> I orignally thought something along the lines of
> 
> $fieldName = $theCursor->record[0]->field[0]->name ;

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list