Hamilton C shell Built-in Procedures


Name
Function
Filename Functions
childpath(p, c) Test whether filename c could be in a subdirectory of p. (Does not test for actual existence of either c or p.)
driveno(p) Drive number implied by pathname p.
fullpath(p) Fully resolve pathname p.
fullmixedpath(p) Fully resolve pathname p and set it into the precise mixed-case representation actually stored in the filesystem.
longname(p) Return the long filename corresponding to the path p. (Not supported under OS/2.)
mixedpath(p) Resolve pathname p into the precise mixed-case representation actually stored in the filesystem. Under Windows NT or Windows 95, any shortname segments will be expanded out to the long form.
samepath(a, b) Test whether two filenames, a and b, point to the same file. The calculation is done by fully resolving the two names and comparing them but can be mistaken if the two paths are based on different UNC names which refer to the same directories.
shortname(p) Return the 8.3 short filename corresponding to the path p, assuming there is one. Useful for preparing arguments to be passed to DOS or Win3.x applications. (Not supported under OS/2.)
Math Functions
abs(x) Absolute value
acos(x) asin(x) atan(x) cos(x) sin(x) tan(x) Trigonometric functions
cosh(x) sinh(x) tanh(x) Hyperbolic functions
ceil(x) Ceiling (lowest integer >= x)
exp(x) log(x) log2(x) log10(x) Exponential and logarithmic functions
floor(x) Floor (highest integer <= x)
round(x) floor(x + 0.5)
sqrt(x) Square root
String Functions
ansi(color) Return an ANSI escape sequence which will produce the specified screen colors. If the argument is ambiguous, e.g., simply "bright," it's taken as a modification of the default colors specified by the COLORS variable.
char(i) Return the character corresponding to the numeric value i.
code(c) Return the numeric encoding of the character c.
concat(a, b, ...) Concatenation of a series of strings.
isinteger(x) Test whether x is an integer. (Remember that null strings and strings consisting only of white space are considered equal to 0.)
isnumber(x) Test whether x is a number.
printf(fmt, ...) Perform C language-style print formatting, returning the result as a string. (See table of format conversions.)
reverse(s) Reverse the order of characters in s.
strindex(a, b) Return the position in a of the first occurrence of b. (0 means b was not found.)
strlen(s) Number of characters in s, represented as a string.
substr(s, b, i) Substring of length i beginning at bth character of s. (i = 0 means "rest of s")
upper(s) lower(s) Translate a string to all upper- or all lower-case.



Previous Topic | Next Topic

Hamilton C shell | Free Updates | Free Demo Software | Win32 Training
Y2K | Customer Testimonials | On-line Hamilton C shell User Guide
Home | Email | Support | Company Profile | Distributors | Links



Copyright © 1997-2001 by Hamilton Laboratories. All rights reserved.
You are visitor number 1179. This page was last modified August 9, 2001.