Regards
Phil
> What would the OCL look like if I wish to obtain the max value of a
> column that contains filename information (ie type varchar)?
File.allInstances->orderby(fileName)->first.fileName
it is not very efficient, but it should work. My standard disclaimer
regarding .allInstances applies as usual: Don't use it unless you
_know_ that the number of instances in the class will remain small (or
you use the OclPsHandle, but that does not apply in this case as it
does not support "->first").
/Jonas
Erm. How do you define max in that case? Lexographical order?
--
Holger
> Jonas Hogstrom [Borland] wrote:
> > File.allInstances->orderby(fileName)->first.fileName
>
> Erm. How do you define max in that case? Lexographical order?
It should probably have been "->last" and not "->first", and yes, it
will do string comparisons. The original question seemed to indicate
that there was a filename involved. The above would work just as fine
for a numeric attribute though.
/Jonas