Validating Input

The pointer returned by astReadastRead (ยง15.4) could identify any class of ObjectObject—this is determined entirely by the external data being read. If it is necessary to test for a particular class (say a FrameFrame), this may be done as follows using the appropriate member of the astIsA$<$Class$>$astIsA$<$Class$>$ family of functions:


\begin{terminalv}
int ok;
\par
...
\par
ok = astIsAFrame( object );
\end{terminalv}

Note, however, that this will accept any Frame, so would be equally happy with a basic Frame or a SkyFrameSkyFrame. An alternative validation strategy would be to obtain the value of the Object's ClassClass attribute and then test this character string, as follows:


\begin{terminalv}
...

This would only accept a basic Frame and would reject a SkyFrame.