home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
262.lha
/
ArpDoc_v1.3
/
Eval
< prev
next >
Wrap
Text File
|
1989-07-01
|
3KB
|
133 lines
Eval(V1.3) ARP User's Manual Eval(V1.3)
NAME
Eval - evaluate arithmetic and logical expressions.
SYNOPSIS
Eval Value1/a Op Value2 TO/k L=LFORMAT/k
DESCRIPTION
Eval computes the results of simple arithmetic and logical
expressions as applied to two arguments, and displays the
result on its standard output. Numeric arguments may be
input as:
Decimal
This is the default, no extra qualifiers needed.
Hexadecimal
Enter hexadecimal numbers as 0x<number> or #x<number>,
for example: 0x1A or #x1A.
Octal
Enter octal numbers as 0<number> or #<number>, for
example: 0777 or #777.
Binary
Binary numbers (in ARP eval only) may be entered with
#B, for example: B1111
Character
Characters are supported only by the Commodore Eval.
The operations supported are given below:
addition + not ~
subtraction - left shift <<
multiplication * right shift >>
division / negation -
mod mod exclusive or xor
and & bitwise equivalence eqv
or |
OPTIONS
TO You can send the output of Eval to a file. However, it
is often more useful to use Eval in a shell which
supports Command substitution (such as the Arp Shell,
ASH).
L=LFORMAT
You can control the output format of Eval using this
keyword. Note that ARP's Eval uses only C style format
commands, while the Commodore Eval uses the old
fashioned BCPL format commands. ARP intends to add
Page 1 (printed 4/28/89)
Eval(V1.3) ARP User's Manual Eval(V1.3)
support for the BCPL format commands in a future
release, while maintaining the modern C style
formatting. Any C format command can be used in the
LFormat string, for example, to display a hexadecimal
number in a field of 8, you can do LFORMAT="%08lx".
You can also include escape characters (such as \n for
a newline) inside your LFORMAT string. For this
release of Eval, you also need to always use the 'l'
(for long) format character with all format commands.
EXAMPLE
There is a good example of Eval and command substitution in
the Ash Manual.
SEE ALSO
AshManual, C Language reference.
Page 2 (printed 4/28/89)