<HTML>
<HEAD>
<TITLE>ARSperl Manual - ars_GetField</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H2><CODE>ars_GetField(ctrl, schema, id)</CODE></H2>
Returns the <A href="ds_field_hash.html">Field Properties Structure</a>.
<p>
<code>id</code> is the numerical Field Id.
<p>
See also <A href="ars_GetListField.html"><code>ars_GetListField</code></a>,
<A href="ars_GetFieldByName.html"><code>ars_GetFieldByName</code></a>,
and <A href="ars_GetFieldTable.html"><code>ars_GetFieldTable</code></a>
<DL>
<DT><B>On success</B><DD>
returns a reference to <A href="ds_field_hash.html">HASH</a>
<DT><B>On failure</B><DD>
returns undef
</DL>
<P>
Example:
<pre>
($field = ars_GetField($c, "User", 8)) || die $arr_errstr;
print $field->{"helpText"};
</pre>
Example of how to retrieve enumerated field labels (e.g. the Status field
labels):
<pre>
($fh = ars_GetField($c, $S, $f{'Status'})) ||
die "GetField: $ars_errstr (no Status field in this schema?)";
if($fh->{dataType} !~ /enum/i) { # ignore case of "enum"
die "'Status' field is not an ENUM.\n";
}
@enumvals = @{$fh->{limit}};
print "Status values: ".join(',', @enumvals)."\n";
</pre>
<hr width="30%">
<p>
<A HREF="toc.html"><IMG ALT="<--" SRC="arrow.gif" ALIGN=CENTER> Table of Contents </A>
<p>
<address>
Last changes to this page 11 September 1998 by Jeff Murphy<P>
© J.C.Murphy, J.W.Murphy 1997 arsperl@smurfland.cit.buffalo.edu
</address>
</BODY>
</HTML>