Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:57 am
by Robert Barr >> Thu, 28 Sep 2000 21:34:00 GMT
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<font face="Arial,Helvetica"><font color="#993300"><font size=-1>Philip,</font></font></font><font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <p><font face="Arial,Helvetica"><font color="#993300"><font size=-1>JADE does have these built in collections under the covers, some of which are</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>exposed to the developer.</font></font></font><font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <p><font face="Arial,Helvetica"><font color="#993300"><font size=-1>Form::controls() allows access to form controls</font></font></font>
<br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>If iterating through these, then you can test for TextBoxes or Buttons - the</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>online help for this method gives a code snippet that does what you want.</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>(Have a look sometime at the online help for the following system classes -</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>they have many 'under the covers' collections and attributes that can be very</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>useful - Schema, Form, Window, Process, Class, Object, ...)</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <p><font face="Arial,Helvetica"><font color="#993300"><font size=-1>Instances count - use the Collection::size() method, which returns an integer.</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>You can use the JADE instances collection (which contains all instances of a</font></font></font>
<br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>given class), or your own application specific (sorted or filtered) collection</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>e.g.</font></font></font> <br><font face="Courier New,Courier"><font color="#993300"><font size=-1> Lot.instances.size</font></font></font>
<br><font face="Courier New,Courier"><font color="#993300"><font size=-1> global.allLotsByName.size</font></font></font><font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <p><font face="Arial,Helvetica"><font color="#993300"><font size=-1>Populating a table - iterate through your collection, calling table.addItem for</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>each row. AddItem() accepts a string, which is the text displayed in the table.</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>Separate each column using a Tab character - the lot name will go into column 3</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>in the code below. It can also be useful when adding rows to associate the</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>object (lot) with the row (* below)</font></font></font>
<br><font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <p><font color="#993300"><font size=-1><font face="Arial,Helvetica">f</font><font face="Courier New,Courier">oreach lot in allLotsByName do</font></font></font>
<br><font face="Courier New,Courier"><font color="#993300"><font size=-1> table.addItem("" &Tab& "" &Tab& lot.name &Tab& ..... remaining columns</font></font></font>
<br><font face="Courier New,Courier"><font color="#993300"><font size=-1> table.accessRow(table.row).itemObject = lot; (*)</font></font></font> <br><font face="Courier New,Courier"><font color="#993300"><font size=-1>endforeach</font></font></font><font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <p><font face="Arial,Helvetica"><font color="#993300"><font size=-1>Note the above is indicative only. There's also lots of other options (and</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>gotchas) for a variety of situations, so read the online help for these and</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>associated calls.</font></font></font><font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <p><font face="Arial,Helvetica"><font color="#993300"><font size=-1>Hope this helps,</font></font></font>
<br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>Rob</font></font></font> <br><font color="#993300"></font>
<br>
<p>Philip wrote:
<blockquote TYPE=CITE>Hi,
<br>Does JADE have built in collections like in Visual Basic where you can
<br>access a collection of forms, command buttons or text boxes etc. If so, how
<br>do i access them.
<br>Also I want to get an Integer value of the number of Instances a Class has,
<br>how can I use that in .... lotTable.rows := [number of instances in class
<br>lots];
<br>Also I want to populate the table with data, eg.
<br>Lots has a property 'name'
<br>I want to put the property 'name' in all the rows in column 3, but for each
<br>row it has to be for a different instance and the rest of the data
on the
<br>row has to be from the same instance.
<br>Can and how can this be done?
<p>thanks,
<br>Philip Q</blockquote>
</html>