Debian Codegraph @

upstream/opensuse-tumbleweed/man3/ordchr.3am

raw
1 .TH ORDCHR 3am "June 29 2025" "Free Software Foundation" "GNU Awk Extension Modules"
2 .SH NAME
3 ordchr \- convert characters to strings and vice versa
4 .SH SYNOPSIS
5 .ft CW
6 @load "ordchr"
7 .sp
8 number = ord("A")
9 .br
10 string = chr(65)
11 .ft R
12 .SH DESCRIPTION
13 The
14 .I ordchr
15 extension adds two functions named
16 .BR ord() .
17 and
18 .BR chr() ,
19 as follows.
20 .TP
21 .B ord()
22 This function takes a string argument, and returns the
23 numeric value of the first character in the string,
24 or \-1 if there was a conversion error.
25 .TP
26 .B chr()
27 This function takes a numeric argument and returns a string
28 whose first character is that represented by the number.
29 It returns the empty string if there was a conversion error.
30 .PP
31 These functions are inspired by the Pascal language functions
32 of the same name.
33 .SH NOTES
34 As of release 5.4 of
35 .IR gawk ,
36 these functions suport wide-character code points.
37 .\" .SH BUGS
38 .SH EXAMPLE
39 .ft CW
40 .nf
41 @load "ordchr"
42 \&...
43 printf("The numeric value of 'A' is %d\en", ord("A"))
44 printf("The string value of 65 is %s\en", chr(65))
45 .fi
46 .ft R
47 .SH "SEE ALSO"
48 .IR "GAWK: Effective AWK Programming" ,
49 .IR filefuncs (3am),
50 .IR fnmatch (3am),
51 .IR fork (3am),
52 .IR inplace (3am),
53 .IR readdir (3am),
54 .IR readfile (3am),
55 .IR revoutput (3am),
56 .IR rwarray (3am),
57 .IR time (3am).
58 .SH AUTHOR
59 Arnold Robbins,
60 .BR [email protected] .
61 .SH COPYING PERMISSIONS
62 Copyright \(co 2012, 2013, 2018, 2025,
63 Free Software Foundation, Inc.
64 .PP
65 Permission is granted to make and distribute verbatim copies of
66 this manual page provided the copyright notice and this permission
67 notice are preserved on all copies.
68 .ig
69 Permission is granted to process this file through troff and print the
70 results, provided the printed document carries copying permission
71 notice identical to this one except for the removal of this paragraph
72 (this paragraph not being relevant to the printed manual page).
73 ..
74 .PP
75 Permission is granted to copy and distribute modified versions of this
76 manual page under the conditions for verbatim copying, provided that
77 the entire resulting derived work is distributed under the terms of a
78 permission notice identical to this one.
79 .PP
80 Permission is granted to copy and distribute translations of this
81 manual page into another language, under the above conditions for
82 modified versions, except that this permission notice may be stated in
83 a translation approved by the Foundation.
84 .\" vim: set filetype=nroff :