Gambas DOC: Returns the key of the last read or last enumerated element.

I'm having problem reading the key of a collection with collection.key. I 
guess gambas is behaving as gambas says it will, however it would be nice to 
be able to get the first key in a collection without having to iterate 
through it (ie having the default action of  collection.key to return the 
first key).

Lets say I have a collection called myCollection which I've loaded with 
database information keyed on the primary key of the table.

Mycollection(999)

If try and get the key of this by this syntax:
        print Mycollection.key
then the key is null

If I do either
        With Mycollection
                print Mycollection.key
        next
or

For each Mycollection
        print Mycollection.key
next

then it prints the key (here 999)

So my question, short of iterating through a collection (even if only one 
member) is there no way to get the key of the collection? Docs I guess say 
not, is this fixable/changeable?

Richard


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to