140 lines
3.0 KiB
HTML
140 lines
3.0 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of ORDCHR</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>ORDCHR</H1>
|
|
Section: GNU Awk Extension Modules (3am)<BR>Updated: Feb 02 2018<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
ordchr - convert characters to strings and vice versa
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
@load "ordchr"
|
|
<P>
|
|
number = ord("A")
|
|
<BR>
|
|
|
|
string = chr(65)
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The
|
|
<I>ordchr</I>
|
|
|
|
extension adds two functions named
|
|
<B>ord()</B>.
|
|
|
|
and
|
|
<B>chr()</B>,
|
|
|
|
as follows.
|
|
<DL COMPACT>
|
|
<DT id="1"><B>ord()</B>
|
|
|
|
<DD>
|
|
This function takes a string argument, and returns the
|
|
numeric value of the first character in the string.
|
|
<DT id="2"><B>chr()</B>
|
|
|
|
<DD>
|
|
This function takes a numeric argument and returns a string
|
|
whose first character is that represented by the number.
|
|
</DL>
|
|
<P>
|
|
|
|
These functions are inspired by the Pascal language functions
|
|
of the same name.
|
|
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>EXAMPLE</H2>
|
|
|
|
|
|
<PRE>
|
|
@load "ordchr"
|
|
...
|
|
printf("The numeric value of 'A' is %d\n", ord("A"))
|
|
printf("The string value of 65 is %s\n", chr(65))
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<I>GAWK: Effective AWK Programming</I>,
|
|
|
|
<I>filefuncs</I>(3am),
|
|
|
|
<I>fnmatch</I>(3am),
|
|
|
|
<I>fork</I>(3am),
|
|
|
|
<I>inplace</I>(3am),
|
|
|
|
<I>readdir</I>(3am),
|
|
|
|
<I>readfile</I>(3am),
|
|
|
|
<I>revoutput</I>(3am),
|
|
|
|
<I>rwarray</I>(3am),
|
|
|
|
<I>time</I>(3am).
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
Arnold Robbins,
|
|
<B><A HREF="mailto:arnold@skeeve.com">arnold@skeeve.com</A></B>.
|
|
|
|
<A NAME="lbAH"> </A>
|
|
<H2>COPYING PERMISSIONS</H2>
|
|
|
|
Copyright © 2012, 2013, 2018,
|
|
Free Software Foundation, Inc.
|
|
<P>
|
|
|
|
Permission is granted to make and distribute verbatim copies of
|
|
this manual page provided the copyright notice and this permission
|
|
notice are preserved on all copies.
|
|
|
|
<P>
|
|
|
|
Permission is granted to copy and distribute modified versions of this
|
|
manual page under the conditions for verbatim copying, provided that
|
|
the entire resulting derived work is distributed under the terms of a
|
|
permission notice identical to this one.
|
|
<P>
|
|
|
|
Permission is granted to copy and distribute translations of this
|
|
manual page into another language, under the above conditions for
|
|
modified versions, except that this permission notice may be stated in
|
|
a translation approved by the Foundation.
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="3"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="4"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="5"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="6"><A HREF="#lbAE">EXAMPLE</A><DD>
|
|
<DT id="7"><A HREF="#lbAF">SEE ALSO</A><DD>
|
|
<DT id="8"><A HREF="#lbAG">AUTHOR</A><DD>
|
|
<DT id="9"><A HREF="#lbAH">COPYING PERMISSIONS</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:49 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|