this is basically what I did, but used arrays rather then ab object.

shameless plug :
https://www.dropbox.com/s/075k0ap7afervs8/Sets_Component_v1.0.zip?dl=0

Distributed as shareware $15 ($35 for source & a suite testing 
routines), it is a compiled/built component created in v13. If you like 
it you are free to reuse/distribute etc.

On Mon, 17 Jul 2017 10:38:04 +0200, Rob Laveaux via 4D_Tech wrote:
> 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: [email protected]
> 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:[email protected]
> **********************************************************************
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**********************************************************************
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:[email protected]
**********************************************************************

Reply via email to