| |
findex
Format:
findex (object-field) |
Purpose:
Returns the index of object-field within the object or
null if object-field is no object field.
Example 1:
input: | <let gl.characters=emptytuple;
gl.characters.Eliza="Eliza Doolittle";
gl.characters.Higgins="Prof. Henry Higgins";
? findex(gl.characters.Eliza) "Nn"; ? " ";
? findex(gl.characters.Higgins) "Nn"; ? " ";
? findex(gl.characters.ET) "Nn";
> | resulting output:
| 0 1 null |
Tip:
The findex() function can be useful
if you want to implement efficient lookup methods with an object field in
another object.
Example 2:
input: | <let actors=array(len(gl.characters));
actors[findex(gl.characters.Eliza)]="Audrey Hepburn";
actors[findex(gl.characters.Higgins)]="Rex Harris";
? "The actor of "+gl.characters.Eliza+" in My Fair Lady is: "
+actors[findex(gl.characters.Eliza)];
> | resulting output:
| The actor of Eliza Doolittle in My Fair Lady is: Audrey Hepburn |
Note that the lookup in
actors[fname(gl.characters.Eliza)]
would have resulted in a search in object actors whereas
actors[findex(gl.characters.Eliza)]
results in a direct access within object actors.
See Also:
fname().
This page was dynamically generated by the
web application development tool RADpage
of H.E.I.
H.E.I. provides support, tools, and services like
Webdesign in Mannheimm,
the HTML/CSS 3D WebGL Animation Library taccgl,
3D Webdesign, and
3D Product ConfiguratorDemo
(3D Produkt Konfigurator Demo in German).
© 1996-2025 H.E.I. All Rights Reserved.
|