Maybe you should take a slightly different approach here.

In the JavaScript framework that comes with NTK Plugin, 4D sets are implemented 
as follows (simplified version).

function RecordSet( table )
{
        assert( table instanceof Table, 'Table object expected' );
        this.id = UUID.new();
        this.table = table;
        app.eval4D( 116, 'CREATE SET', '([' + this.table.name + '];"' + this.id 
+ '")' );
}

So basically a RecordSet is an object with two properties: the id/name of the 
set (a UUID) and a reference to the table. There are some more set related 
functions that build upon this, but I have not listed those here.

If you would translate this into 4D, you would get something like this:

  // (PM) Set_Create
  // $1 = Table
  // $0 = RecordSet object

C_POINTER($1;$table)
C_OBJECT($0;$recordSet)
C_TEXT($id)

$table:=$1
$id:=Generate UUID

CREATE SET($table->;$id)

OB SET($recordSet;"table";$table;"id";$id)

$0:=$recordSet

Now you have the name of the set and the table it belongs to wrapped in a 
single variable. You can then add some more wrapper methods which use this 
RecordSet object.

HTH,

- Rob Laveaux

--------------------------------------------------------
Pluggers Software
Scholekstersingel 48
2496 MP  Den Haag
The Netherlands

Email: rob.lave...@pluggers.nl
Website: http://www.pluggers.nl

--------------------------------------------------------



**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to