ABORT - AXES

ABORT

Supported On UX WS DOS IN
Option Required IO
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes

ABORT terminates I/O activity on the specified HP-IB interface.

Example Statements

ABORT 7
ABORT Isc
IF Stop_code THEN ABORT @Source

Syntax

Item Description Range
interface select code numeric expression, rounded to an integer 5, 7 through 31
I/O path name name assigned to an HP-IB interface --

Semantics

Do not use this statement to specify other types of interfaces. Error 150 results if you specify a select code for any other type of interface.

If the computer is the system controller but not currently the active controller, executing ABORT causes the computer to assume active control.

Note that ABORT interface_select is allowed, but ABORT primary_address is not. For example:


ABORT 7       allowed
ABORT 721     not allowed

The details of interface select codes and primary addresses are introduced in the "Data Flow" chapter of the HP BASIC Programming Guide.

Summary of Bus Actions
System Controller Not System Controller
Active Controller IFC (duration >= µsec)

                      REN

                     ATN                

ATN

MTA

UNL

ATN

Not Active Controller IFC (duration >=100 µsec)1

                         REN

                   ATN          

No

Action

1 The IFC message allows a non-active controller (which is the system controller) to become active.

ABORTIO

Supported On UX WS DOS
Option Required TRANS
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes

ABORTIO terminates a TRANSFER which is taking place through an I/O path assigned to a device, group of devices, mass storage file, or pipe in HP BASIC/UX.

Example Statements

ABORTIO @Isc
IF Stop_flag THEN ABORTIO @Device

Syntax

Item Description Range
I/O path name name assigned to a device, a group of devices, mass storage file, or pipe any valid name

Semantics

This statement terminates a TRANSFER (in either direction) currently taking place through the specified I/O path name. The specified I/O path must correspond to one of the following:

If ABORTIO is used for I/O paths assigned to buffers, error 170 is reported.

An end-of-transfer (EOT) branch is initiated if an ON EOT branch is currently defined for the I/O path name; however, no currently defined EOR branch is initiated.

ABORTIO has no effect if no TRANSFER is taking place through the I/O path name.

If a TRANSFER to or from an I/O path name was terminated by an error, executing ABORTIO on that I/O path name causes the error to be reported.

ABS

Supported On UX WS DOS IN
Option Required None
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes

ABS returns the absolute value of its argument.

Example Statements

Magnitude=ABS(Vector)
PRINT "Value =";ABS(X1)

Syntax

Item Description/Default Range\Restrictions
argument numeric expression within valid ranges of INTEGER and REAL data types for INTEGER and REAL arguments. See Range Restriction Specifics for COMPLEX arguments

Semantics

To compute the absolute value of a COMPLEX value, the COMPLEX binary must be loaded.

Range Restriction Specifics

The formula for computing ABS for COMPLEX arguments is:

           SQRT(Real_part*Real_part  + Imag_part*Imag_part)

where Real_part is the real part of the COMPLEX argument and Imag_part is the imaginary part of the COMPLEX argument in the ABS function. Some values of a COMPLEX argument may cause errors in this computation. For example:

            ABS(CMPLX(MAXREAL,MAXREAL))

will cause error 22 (error 21 in HP BASIC/UX 700) due to the computation Real_part*Real_part.

The result returned when executing the ABS function for COMPLEX numbers is always a positive REAL value.

Taking the ABS of the INTEGER -32768 will cause an error.

ACS

Supported On UX WS DOS IN
Option Required None
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes

ACS returns the arccosine of its argument.

Example Statements

Angle=ACS(Cosine)
PRINT "Angle = ";ACS(CMPLX(2.67,-6))

Syntax

Item Description/Default Range\Restrictions
argument numeric expression -1 through +1 for INTEGER and REAL arguments. See Range Restriction Specifics below for COMPLEX arguments and underflow conditions.

Semantics

If the argument of ACS is REAL or INTEGER, the value returned is REAL. If the argument is COMPLEX, the value returned is COMPLEX. To compute the ACS of a COMPLEX value, the COMPLEX binary must be loaded.

The angle mode (set by RAD or DEG) determines whether the value returned is in degrees or radians. If the current angle mode is DEG, the range of the result is 0 to 180 degrees. If the current angle mode is RAD, the range of the result is 0 to PI radians. The angle mode is radians unless you specify degrees with the DEG statement.

Range Restriction Specifics

The formula used for computing the ACS of a COMPLEX value is:

               -i * LOG(Argument+SQRT(Argument*Argument-1))

where i is the COMPLEX value CMPLX(0,1) and Argument is a COMPLEX argument to the ACS function. Some values of a COMPLEX argument may cause errors in this computation. For example,

              ACS(CMPLX(MAXREAL,0))

will cause error 22 (error 21 in HP BASIC/UX 700) due to the Argument*Argument computation. Also, the COMPLEX argument

              ACS(CMPLX(MINREAL,0))

will cause error 21 in HP BASIC on Series 700 due to underflow if the underflow mode is set to Error. The principle value, which has a real part between 0 and ( radians, is returned for COMPLEX arguments.

The following range restrictions apply in HP BASIC/UX 700 when underflow mode (CONTROL 32,7;mode) is set to Error or Ignore.

Range Underflow Mode\Error Underflow Mode\Ignore
Positive Maximum +1.00000000000000E+000 +1.00000000000000E+000
Negative Minimum -1.00000000000000E+000 -1.00000000000000E+000
Positive Minimum +5.11091385101442E-103 +4.94065645841247E-3241
Negative Maximum -5.11091385101442E-103 -4.94065645841247E-3242

1An underflow in Ignore mode results in a denormalized number that is less than the value for +MINREAL.

2An underflow in Ignore mode results in a denormalized number that is greater than the value for -MINREAL.

ACSH

Supported On UX WS DOS
Option Required COMPLEX
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes

ACSH returns the hyperbolic arccosine of its argument.

Example Statements

Result=ACSH(5.7089)
PRINT "Hyperbolic Arccosine = ";ACSH(Expression)

Syntax

Item Description/Default Range\Restrictions
argument numeric expression INTEGER and REAL arguments must be >1 and <1.340 780 792 99 E 154; see "Range Restriction Specifics" for COMPLEX arguments and underflow conditions.

Semantics

If an INTEGER or REAL argument is given, this function returns a REAL value. If a COMPLEX argument is given, this function returns a COMPLEX value.

Range Restriction Specifics

The formula for computing ACSH is as follows:

LOG(Argument+SQRT(Argument*Argument-1))

where Argument is the argument to the ACSH function. Some values of an argument may cause errors in this computation. For example,

              ACSH(MAXREAL)

will cause error 22 (error 21 in HP BASIC/UX 700) due to the computation Argument*Argument.

Note that the hyperbolic arccosine of a COMPLEX number returns a principle value which has an imaginary part which falls in the range of 0 to positive PI.

The following range restrictions apply in HP BASIC/UX 700 when underflow mode (CONTROL 32,7;mode) is set to Error or Ignore.

Range Underflow Mode\Error Underflow Mode\Ignore
Positive Maximum +1.34078079299426E+154 +1.34078079299426E+154
Positive Minimum +1.00000000000000E+000 +1.00000000000000E+000

ALLOCATE

Supported On UX WS DOS
Option Required None
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes

ALLOCATE dynamically allocates memory for arrays and string variables during program execution.

Example Statements

ALLOCATE Temp(Low:High)
ALLOCATE INTEGER Array(Index,2,8)
ALLOCATE R$[LEN(A$)+1]
ALLOCATE Text$(Lines)[80]

Item Description Range
array name name of a numeric array any valid name
lower bound numeric expression, rounded to an integer; Default = OPTION BASE value (0 or 1) -32 768 through +32 767 (see array in Glossary)
upper bound numeric expression, rounded to an integer -32 768 through +32 767 (see array in Glossary)
string name name of a string variable any valid name
string length numeric expression, rounded to an integer 1 through 32 767

Semantics

Memory reserved by the ALLOCATE statement can be freed by the DEALLOCATE statement. However, because of the stack discipline used when allocating, the freed memory space does not become available unless all subsequently allocated items are also deallocated. For example, assume that A$ is allocated first, then B$, and finally C$. If a DEALLOCATE A$ statement is executed, the memory space for A$ is not available until B$ and C$ are deallocated. This same stack is used for setting up ON-event branches, so subsequent ON-event statements can also block the availability of deallocated memory.

The total number of elements that can be allocated for variables within any one context or COM area (i.e., any "value area") is limited to 16 777 215 bytes.

The variables in an ALLOCATE statement cannot appear in the same context in declaration statements such as COM, DIM, or INTEGER. If variable(s) are to be allocated in a subprogram, the variable(s) cannot have been included in the subprogram's formal parameter list. Implicitly declared variables cannot be allocated. Numeric variables for which a type is not specified are assumed to be REAL. A variable can be re-allocated in its program context only if it has been deallocated and its type and number of dimensions remain the same.

ALLOCATE allows you to dynamically allocate memory for arrays. However, the array dimensions are determined statically. Thus you can change the size of the dimensions, but you cannot change the number of dimensions of an array within a program context.

Exiting a subprogram automatically deallocates any memory space allocated within that program context.

ALLOCATE can be executed from the keyboard while a program is running or paused. However, the variable must have been declared in an ALLOCATE statement in the current program context.

ALPHA HEIGHT

Supported On UX WS DOS
Option Required CRTX
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes

ALPHA HEIGHT sets the number of lines of text visible in the CRT's alpha area.

Example Statements

ALPHA HEIGHT Num_of_lines
ALPHA HEIGHT 18
IF Total_lines = 10 THEN ALPHA HEIGHT 18
ALPHA HEIGHT

Syntax

Item Description/Default Range Restrictions
number of lines numeric expression (see Semantics)

Semantics

ALPHA HEIGHT is used to restrict the alpha screen to the bottom n lines of the display, leaving the upper part of the display for graphics. This can be used to prevent alpha from interfering with graphics.

The number of lines available for alpha on the CRT depends on which display is being used. The following are the upper limits for the ALPHA HEIGHT statement: 22, 25, 26, 30, 42, 48, 51, and 56. The lower limit is 9 in all cases (can be others in a windowing environment).

ALPHA HEIGHT without any parameters restores the default height (one of the upper limits mentioned above). The minimum argument to this statement is always 9; however, when you are in Edit mode the minimum alpha height is 14. Note that upon entering the Edit mode if the ALPHA HEIGHT is a value in the range of 9 to 13 it will be changed to 14 (in HP BASIC/UX, it will not be changed).

Note that the functionality of this statement can be achieved through CRT CONTROL register 13; however, you cannot execute the CONTROL statement without a parameter in order to get the default alpha height.

ALPHA ON/OFF

Supported On UX* WS DOS*
Option Required GRAPH
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes

ALPHA turns the alphanumeric raster (but not graphics) on or off.

Example Statements

ALPHA ON
IF Graph THEN ALPHA OFF

Syntax

Semantics

Items sent to the PRINT area while the alpha display is off are placed in the display memory even though they are not visible. Items sent to the keyboard input line, the DISP line, or the system message line will turn ALPHA ON. The alphanumeric and graphic rasters can both be on at the same time.

The alphanumeric area is enabled after power-on, RESET, and SCRATCH A. Pressing the [ALPHA] key on the keyboard also enables the alphanumeric raster.

Bit-Mapped Alpha Displays

This statement has no effect on a bit-mapped alpha display when the alpha write-enable mask specifies all planes. This is the default state on those displays.

If ALPHA MASK <> 2^n-1, then planes enabled for alpha can be turned on and off. See SET ALPHA MASK in this reference for more information.

HP BASIC/UX Specifics

ALPHA ON and ALPHA OFF have no effect in a windowing environment or on single bit-plane terminals. It functions the same, however, on a bit-mapped console.

HP BASIC/DOS Specifics

ALPHA ON and ALPHA OFF functions only in SEPARATE ALPHA mode, which is supported only for VGA and EGA displays.

ALPHA PEN

Supported On UX WS DOS
Option Required CRTX
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes

ALPHA PEN sets the color or gray scale of text in the alphanumeric display.

Example Statements

ALPHA PEN Pen_value
ALPHA PEN 142
IF Cyan THEN ALPHA PEN 140

Syntax

Item Description/Default Range Restrictions
pen value numeric expression (see Semantics)

Semantics

The set of alpha colors for the Model 236C is given in the following table:

Value Result
16 The number is evaluated MOD 8 and resulting values produce the following:

0 -- black

1 -- white

2 -- red

3 -- yellow

4 -- green

5 -- cyan

6 -- blue

7 -- magenta

16 to 135 Ignored
136 White
137 Red
138 Yellow
139 Green
140 Cyan
141 Blue
142 Magenta
143 Black
144 to 255 Ignored

This statement has no effect on single plane monochrome displays. On gray scale (multi-plane monochrome) displays this statement changes the display color to a different shade of gray.

For bit-mapped alpha displays, ALPHA PEN specifies the pen to be used for subsequent alpha output. The range of values allowed with this statement are 0 through 255; these values are treated as MOD 2^n, where n is the number of display planes.

ALPHA PEN n or CONTROL CRT,5; n set the values of the CRT registers 15, 16, and 17 (or PRINT PEN, KEY LABELS PEN and KBD LINE PEN, respectively), but the converse is not true. That is, STATUS CRT,5 may not accurately reflect the CRT state if control registers 15, 16, and/or 17 have been set.

Note that the functionality of this statement can be achieved through CRT CONTROL register 5.

AND

Supported On UX WS DOS IN
Option Required None
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes

AND returns a 1 or a 0 based on the logical AND of its two arguments.

Example Statements

IF Flag AND Test2 THEN Process
Final=Initial AND Valid

Syntax

Semantics

A non-zero value (positive or negative) is treated as a logical 1; only zero is treated as a logical 0.

A B A AND B
0 0

0

0 1

0

1 0

0

1 1

1

APPEND

See ASSIGN, DUMP DEVICE IS, PLOTTER IS, PRINTALL IS, and PRINTER IS.

AREA

Supported On UX WS DOS
Option Required GRAPHX
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes

AREA defines or selects an area fill color. The fill color is used in all subsequent graphics operations requiring area fill.

Example Statements

AREA COLOR Hue,Saturation,Luminosity
AREA INTENSITY Red(I),Green(I),Blue(I)
AREA PEN 3

Syntax

Item Description Range
hue numeric expression 0 through 1
saturation numeric expression 0 through 1
luminosity numeric expression 0 through 1
red numeric expression 0 through 1
green numeric expression 0 through 1
blue numeric expression 0 through 1
pen selector numeric expression, rounded to an integer -32 768 through +32 767

Semantics

The default fill color is the color specified by pen 1. This color is solid white after power-up, SCRATCH A, GINIT. It is also set to white after LOAD BIN "GRAPH" when this binary is not already resident in memory.

A fill color remains in effect until the execution of an AREA, GINIT, or SCRATCH A. Other statements which may alter the current fill color (if the data passed to them is an array) are:

SET PEN affects pen colors, and therefore can also affect fill colors specified with AREA statements.

Specifying color with the SET PEN and AREA PEN statements (resulting in non-dithered color) results in a much more accurate representation of the desired color than the same color requested with an AREA COLOR or AREA INTENSITY statement.

AREA PEN

A fill color specified with AREA PEN is guaranteed to be non-dithered, and the AREA PEN statement executes faster than AREA COLOR or AREA INTENSITY.

The pen numbers have the same effect as described in the PEN statement for line color except that in the alternate pen mode, negative pens erase as in the normal pen mode; they do not complement. Pen 0 in normal pen mode erases; it does not complement.

AREA COLOR

When AREA COLOR executes on a computer with a color display, the HSL parameters are converted to RGB values. Then, if the color requested is not available in the color map, the computer creates the closest possible color in RGB color space to the one requested by filling the 4 by 4 dither cell with the best combination of colors from the color map.

In non-color map mode, there are eight colors total, and they cannot be redefined. This simulates the operation of the HP 98627A.

In color map mode, there are 2n total colors (where n is the number of planes in the graphics display), and they can be redefined with SET PEN.

The example program COLORS, on the MANUAL EXAMPLES disk, shows the effects of the AREA command. It shows the changes brought about by varying one of HSL parameters at a time. The bottom bar shows that when saturation (the amount of color) is zero, hue makes no difference, and varying luminosity results in a gray scale.

COLORS also displays a color wheel representing the colors selected as the hue value goes from 0 through 1. Any value between zero and one, inclusive, can be chosen to select color. The resolution (the amount the value can change before the color on the screen changes) depends on what the value of the hue is as well as the values of the other two parameters.

It then shows the effect that varying saturation and luminosity have on the color produced. Each of the small color wheels is a miniature version of the large one above, except it has fewer segments.

AREA INTENSITY

The example program COLORS, on the MANUAL EXAMPLES disk, demonstrates the effect of varying the intensity of one color component when the other two remain constant.

It also shows combinations of red, green and blue. The values are given in fifteenths: 0 fifteenths, 5 fifteenths, 10 fifteenths, and 15 fifteenths--every fifth value. The values for each color component are represented in that color.

The HP98627A

When an HP98627A is used, the HSL values specified in an AREA COLOR statement are converted to RGB. The parameters of an AREA INTENSITY statement are already in RGB. The RGB values specify the fraction of dots per 4-by-4 pixel area to be turned on in each memory plane. The red value corresponds to memory plane 1, the green value to memory plane 2, and the blue value to memory plane 3.

The AREA PEN selects one of the eight non-dithered colors available with no intensity control on the color guns. See the PEN entry for the order of these colors.

The HP 98627A dithers in a very similar way to the Model 236 with color monitor when the color map is not enabled (see PLOTTER IS), using only eight colors when calculating the closest combination.

Monochromatic Displays

When doing shading on a monochromatic display, dithering is always used. Dithering takes place in a 4-by-4 cell, which allows zero through sixteen of the dots to be turned on, for a total of seventeen shades of gray.

Since AREA PEN does not use dithering, only black and white are available. If the pen selector is positive, the resulting fill color is white; if zero or negative, the resulting fill color is black.

When an AREA COLOR is executed, the hue and saturation parameters are ignored. Only the luminosity value is used to determine the fraction of pixels to be turned on.

When an AREA INTENSITY is executed, the largest of the three values is used, and it specifies the fraction of pixels to be turned on.

Gray Scale Displays

Gray scale displays provide various intensities of gray by actually adjusting the luminosity of each pixel. Refer to PEN and PLOTTER IS for gray scale tables. For additional information, refer to the chapter "Color and Gray Scale Graphics" in the BASIC Advanced Programming Techniques manual.

Alternate Pen Mode Fills

If the alternate drawing mode is in effect when the fill is performed, the area will be filled with non-dominant color. See GESCAPE operation selectors 4 and 5.

In the alternate pen mode, negative pens erase as in the normal pen mode; they do not complement.

HP BASIC/DOS Specifics

For a VGA color display, the fill color selections are the same as for a Series 300 display. For an EGA display, the fill color selections are limited.

ARG

Supported On UX WS DOS
Option Required COMPLEX
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes

ARG returns the argument (the angle in polar coordinates) of a COMPLEX number.

Example Statements

X=ARG(Complex_expr)
Result=ARG(CMPLX(2.1,-8))

Syntax

Item Description/Default Range\Restrictions
argument numeric expression Any valid INTEGER, REAL, or COMPLEX value. See Semantics for underflow conditions.

Semantics

This is equivalent to ATN2(CMPLX(Imag_part,Real_part)) in FORTRAN. The value returned is REAL. If the current angle mode is DEG, the range of the result is -180° through +180°. If the current angle mode is RAD, the range of the result is -PI through +PI radians. The default mode is radians.

This function returns 0 when given an INTEGER or REAL argument.

The following range restrictions apply in HP BASIC/UX 700 when underflow mode (CONTROL 32,7;mode) is set to Error or Ignore.

Range Underflow Mode\Error Underflow Mode\Ignore
Positive Maximum +1.79769313486232E+308 +1.79769313486232E+308
Negative Minimum -1.79769313486232E+308 -1.79769313486232E+308
Positive Minimum +2.22507385850720E-308 +4.94065645841247E-324 1
Negative Maximum -2.22507385850720E-308 -4.94065645841247E-324 2

1An underflow in Ignore mode results in a denormalized number that is less than the value for +MINREAL.

2An underflow in Ignore mode results in a denormalized number that is greater than the value for -MINREAL.

ASCII

See CREATE ASCII and LEXICAL ORDER IS.

ASN

Supported On UX WS DOS IN
Option Required None
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes

ASN returns the arcsine of its argument.

Example Statements

Angle=ASN(Sine)
PRINT "Angle = ";ASN(CMPLX(-2.98,3))

Syntax

Item Description/Default Range\Restrictions
argument numeric expression -1 through +1 for INTEGER and REAL arguments; see Range Restriction Specifics for COMPLEX arguments and underflow conditions.

Semantics

The angle mode (set by RAD or DEG) determines whether the value returned is in degrees or radians. If the current angle mode is DEG, the range of the result is -90 to +90 degrees. If the current angle mode is RAD, the range of the result is -PI/2 to +PI/2 radians. The angle mode is radians unless you specify degrees with the DEG statement.

If the argument is REAL or INTEGER, the value returned is REAL. If the argument is COMPLEX, the value returned is COMPLEX.

To compute the ASN of a COMPLEX value, the COMPLEX binary must be loaded.

Range Restriction Specifics

The formula for computing the ASN of a COMPLEX value is:

       -i*LOG(i*Argument+SQRT(1-Argument*Argument))

where i is the COMPLEX value CMPLX(0,1) and Argument is a COMPLEX argument to the ASN function. Some values of a COMPLEX argument may cause errors in this computation. For example:

      ASN(CMPLX(MAXREAL,0))

will cause error 22 (error 21 in HP BASIC/UX 700) due to the Argument*Argument computation.

The principle value, which has a real part between -PI/2 to +PI/2~~ , is returned for COMPLEX arguments.

The following range restrictions apply in HP BASIC/UX 700 when underflow mode (CONTROL 32,7;mode) is set to Error or Ignore.

Range Underflow Mode\Error Underflow Mode\Ignore
Positive Maximum +1.00000000000000E+000 +1.00000000000000E+000
Negative Minimum -1.00000000000000E+000 -1.00000000000000E+000
Positive Minimum +5.11091385101442E-103 +4.94065645841247E-324 1
Negative Maximum -5.11091385101442E-103 -4.94065645841247E-324 2

1 An underflow in Ignore mode results in a denormalized number that is less than the value for +MINREAL.

2 An underflow in Ignore mode results in a denormalized number that is greater than the value for -MINREAL.

ASNH

Supported On UX WS DOS
Option Required COMPLEX
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes

ASNH returns the hyperbolic arcsine of its argument.

Example Statements

Result=ASNH(-.2475)
PRINT "Hyperbolic Arcsine = ";ASNH(Expression)

Syntax

Item Description/Default Range\Restrictions
argument numeric expression absolute value

<1.340 780 792 99 E+154 and

>1.491 668 146 24 E -154

 for INTEGER and REAL arguments; see "Range Restriction Specifics" for additional restrictions.

Semantics

If an INTEGER or REAL argument is given, this function returns a REAL value. If a COMPLEX argument is given, this function returns a COMPLEX value.

Range Restriction Specifics

The formula use for computing the ASNH is as follows:

           LOG(Argument+SQRT(Argument*Argument+1))

where Argument is the argument to the ASNH function. Some values of a COMPLEX argument may cause errors in this computation. For example:

          ASNH(CMPLX(MAXREAL,0))

will cause error 22 (REAL overflow) (error 21 in HP BASIC/UX 700) due to the Argument*Argument computation.

Note that the ASNH of a COMPLEX number returns a principle value which has an imaginary part that falls in the range of -PI/2 to +PI/2.

The following range restrictions apply in HP BASIC/UX 700 when underflow mode (CONTROL 32,7;mode) is set to Error or Ignore.

Range Underflow Mode\Error Underflow Mode\Ignore
Positive Maximum +1.34078079299426E+154 +1.34078079299426E+154
Negative Minimum -1.34078079299426E+154 -1.34078079299426E+154
Positive Minimum +2.22507385850720E-308 +4.94065645841247E-3241
Negative Maximum -2.22507385850720E-308 -4.94065645841247E-324 2

1An underflow in Ignore mode results in a denormalized number that is less than the value for +MINREAL.

2An underflow in Ignore mode results in a denormalized number that is greater than the value for -MINREAL.

ASSIGN

Supported On UX* WS DOS IN*
Option Required None
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes

ASSIGN assigns an I/O path name and attributes to one of the following:

Example Statements

These statements assign an I/O path name to a file:

ASSIGN @File TO File_name$
ASSIGN @File TO File_name$; FORMAT OFF
ASSIGN @File TO File_name$; FORMAT OFF, SWAP OFF
ASSIGN @File TO * ! Close the file.

These statements assign an I/O path name to an instrument:

ASSIGN @Hpib_scope TO 724
ASSIGN @Serial_scope TO 9
ASSIGN @Buf_2 TO BUFFER Numeric_Array(*)
ASSIGN @Source;FORMAT ON
ASSIGN @Listeners TO 711,712,715
ASSIGN @File TO "/WORKSTATIONS/MyDir/MyFile:,700"
ASSIGN @Srm_file TO "P1/FredsData<pass>:REMOTE"
ASSIGN @File TO Name$;APPEND
The following examples require the TRANS binary:
ASSIGN @Buf_1 TO BUFFER String_variable$
ASSIGN @Buf_2 TO BUFFER Numeric_Array(*)
ASSIGN @Buf_3 TO BUFFER [128]
The following examples require the IO binary:
ASSIGN @Resource TO Gpio;WORD,CONVERT IN BY INDEX In$
ASSIGN @Resource;CONVERT OUT BY INDEX Out$
ASSIGN @Resource TO Hpib;EOL Eol$ END DELAY .05
ASSIGN @Resource TO Rs_232;PARITY ODD
The following examples require the LANGUAGE binary:
ASSIGN @Printer TO 701;EXCHANGE "HP-16"
ASSIGN @Printer;EXCHANGE OFF
ASSIGN @Printer TO 701;EXCHANGE "JIS" SHIFT IN In$ OUT Out$
Item Description Range
I/O path namename identifying an I/O path any valid name
device selector numeric expression (see Glossary)
file specifier string expression(see drawing)
string variable namename of a string variable any valid name (see Glossary)
numeric array name name of a numeric array any valid name
buffer size (in bytes) numeric expression, rounded to an integer 1 through available memory minus 690
attribute attribute to be assigned to the I/O path

(see drawing)
directory path literal (see MASS STORAGE IS)
file name literal

depends on volume's format (see Glossary)
LIF protect code literal; first two non-blank characters are significant> not allowed

SRM passwordliteral; first 16 non-blank characters are significant> not allowed

volume specifierliteral(see MASS STORAGE IS)
conversion string

name of a string variableup to 256 characters (with INDEX); even number of characters (with PAIRS)

end-of-line characters string expression; Default=CR and LF up to 8 characters
time period

numeric expression, rounded to the nearest 0.001 seconds; Default=0 0.001 through 32 767

return variable name

name of a numeric variable any valid name
exchange string string expression

choices depend on LANGUAGE
shift in string

string expression depends on printer used; six bytes maximum

shift out string string expression depends on printer used; six bytes maximum

Semantics

The ASSIGN statement serves a variety of purposes. Its main purpose is to open (create) an I/O path name and assign that name to a resource. ASSIGN can specify attributes that describe how data is shared with the resource. ASSIGN can also close (terminate) an I/O path. An I/O path name is associated with a unique internal structured data type. I/O path names can be placed in COM statements and can be passed by reference as parameters to subprograms. They cannot be evaluated in a numeric or string expression and cannot be passed by value. Once an I/O path name has been assigned to a resource, OUTPUT, ENTER, TRANSFER, STATUS, and CONTROL operations can be directed to that I/O path name. This provides the convenience of re-directing I/O operations in a program by simply changing the appropriate ASSIGN statement. The resource assigned to the I/O path name may be an interface, a device, a group of devices on HP-IB, a mass storage file, pipe, or a buffer. Note that the STATUS and CONTROL registers of an I/O path are different from the STATUS and CONTROL registers of an interface. All STATUS and CONTROL registers are summarized in the "Interface Registers" section at the back of this book.

Wildcards

If you are using a version of HP BASIC that supports wildcards, you can use them in file specifiers with ASSIGN. Wildcard file specifiers used with ASSIGN must match one and only one file name. You must first enable wildcard recognition using WILDCARDS. Refer to the keyword entry for WILDCARDS for details.

Using FORMAT Attributes

Assigning the FORMAT ON attribute to an I/O path name directs the computer to use its ASCII data representation while sending and receiving data through the I/O path. Assigning the FORMAT OFF attribute to an I/O path name directs the computer to use its internal data representation when using the I/O path. If the file was created with the CREATE ASCII statement, the file is always accessed as a LIF ASCII file. LIF ASCII is a file type used by certain HP computers, such as the HP BASIC Workstation. If you specify FORMAT ON or FORMAT OFF for such a file, it is ignored. If a FORMAT attribute is not explicitly given to an I/O path, a default is assigned. The following table shows the default FORMAT attribute assigned to computer resources.
Resource Default Attribute
interface/device FORMAT ON
ASCII file (always ASCII format)
BDAT file FORMAT OFF
DOS file FORMAT OFF
HP-UX file FORMAT OFF
buffer FORMAT ON
pipe FORMAT ON
The FORMAT OFF attribute cannot be assigned to an I/O path which currently possesses any non-default CONVERT or PARITY attribute(s), and vice versa.

Using Files

Assigning an I/O path name to a file associates the I/O path with the file and opens the file for reading and writing. The file must be a data file. You cannot, for example, ASSIGN an I/O path to a PROG (program) file. The file must already exist; ASSIGN does not do an implied CREATE. Files have a position pointer which is associated with each I/O path name. The pointer identifies the next byte to be written or read. The pointer is reset to the beginning of the file when the file is opened, and updated with each ENTER or OUTPUT that uses that I/O path name. It is best if a file is open with only one I/O path name at a time. BDAT and HP-UX files have an additional physical end-of-file pointer. This end-of-file pointer (which resides on the media) is read when the file is opened. This end-of-file pointer is updated on the media at the following times:

Using Instruments

I/O path names are assigned to instruments and other devices by placing the device selector after the keyword TO. The statement ASSIGN @Meters TO 710,711,712 creates the I/O path name @Meters and assigns it to a group of three devices on HP-IB. When multiple devices are specified, they must be connected to the same interface. When an I/O path name which specifies multiple devices is used in an OUTPUT statement, all devices referred to by the I/O path name receive the data. When an I/O path name which specifies multiple devices is used in an ENTER statement, the first device specified sends the data to the computer and to the rest of the devices. When an I/O path name which specifies multiple HP-IB devices is used in either CLEAR, LOCAL, PPOLL CONFIGURE, PPOLL UNCONFIGURE, REMOTE, or TRIGGER statement, all devices associated with the I/O path name receive the HP-IB message. A device can have more than one I/O path name associated with it. Each I/O path name can have different attributes (such as FORMAT and SWAP), depending upon how the device is used. The specific I/O path name used for an I/O operation determines which set of attributes is used for that operation. ~~

Using APPEND

Using ASSIGN with APPEND requires the MS binary. Normally, opening a file with ASSIGN will reset the current position pointer to the beginning of the file. Thus, an existing file is overwritten. If instead you wish to append more data to an existing file, use ASSIGN with APPEND. Note that APPEND works with HPUX, LIF, and BDAT file types on SRM or HFS File Systems.

HFS Permissions

ASSIGN opens any existing ASCII, BDAT, or HP-UX file if you currently have R (read) or W (write) access permission on the file as well as X (search) permission on the parent and all superior directories. Otherwise, error 183 is reported.

SRM Access Capabilities (not supported on HP BASIC/UX 700)

ASSIGN opens any existing ASCII, BDAT, or HP-UX file, regardless of protection on the file except when all access capabilities (MANAGER, READ and WRITE) are taken from the public. Attempts to use ASSIGN with a file whose capabilities are fully protected (without supplying the necessary passwords) will result in error 62. The file's specific access capabilities are not checked at ASSIGN time. A subsequent operation on the file associated with the I/O path name is not performed, however, unless you have the proper access capability for that operation. For example, you may ASSIGN an I/O path name to a file that has only the READ capability public; but attempting to perform an OUTPUT operation generates error 62, since the WRITE access capability is not public (this operation would be successful if you specify the WRITE password in the ASSIGN statement).

Locked SRM Files (not supported on HP BASIC/UX 700)

With SRM volumes, existing ASCII, BDAT, and HP-UX files opened via ASSIGN are opened in shared mode, which means that several users can open a file at the same time. If you lock a file (refer to LOCK) and subsequently open that file via ASSIGN using the same @name (for example, to reset the file pointer), the ASSIGN automatically unlocks the file (refer to UNLOCK). To maintain sole access to the file, you must LOCK it again. Closing an I/O path via ASSIGN (ASSIGN @Io_path TO *) unlocks as well as closes the file (regardless of the number of LOCKs in effect for the file at the time).

Using Buffers

Using ASSIGN to create a buffer requires the TRANS binary. The ASSIGN statement is also used to create a buffer (called an "unnamed" buffer) and assign an I/O path name to it or to assign an I/O path name to a buffer (called a "named" buffer) which has been previously declared. Once assigned an I/O path name, a buffer may be the source or destination of a TRANSFER, the destination of an OUTPUT, or the source of an ENTER statement. I/O path names assigned to buffers contain information describing the buffer, such as buffer capacity, current number of bytes, and empty and fill pointers. This information can be read from STATUS registers of the I/O path name; some of this information may be modified by writing to CONTROL registers. See the "Interface Registers" section at the back of this manual for I/O path register definitions; the HP BASIC Interface Reference provides tutorial information about these interface registers. The ASSIGN statement that assigns the I/O path name to a named buffer (or creates an unnamed buffer) sets these registers to their initial values: the buffer type is set to either 1 (named buffer) or 2 (unnamed buffer); the empty and fill pointers are set to 1; the current-number-of-bytes register and all other registers are set to 0. Named buffers can also be accessed through their variable names in the same manner that other variables of that data type can be accessed. However, with this type of access, the buffer registers are not updated; only the data in the buffer changes. For example, using LET to place characters in a named string-variable buffer does not change the empty and fill pointers or the current-number-of-bytes register; only the buffer contents and string's current length can be changed. It is highly recommended that the string's current length (set to the string's dimensioned length by ASSIGN) not be changed in this manner. Unnamed buffers can be accessed only through their I/O path names. Using ENTER, OUTPUT, or TRANSFER to access a named buffer through its I/O path name updates the appropriate buffer registers automatically; this is unlike accessing a named buffer through its declared variable name (as above). An I/O path name cannot be assigned to a buffer which will not exist for as long as the I/O path name; this "lifetime" requirement has several implications. Buffers cannot be declared in ALLOCATE statements. If a buffer's I/O path name is to appear in a COM block, the buffer must appear in the same COM block; thus, I/O path names assigned to unnamed buffers cannot appear in COM. If a buffer's I/O path name is to be used as a formal parameter of a subprogram, the buffer to which it will be assigned must appear in the same formal parameter list or appear in a COM which is accessible to that subprogram context. An I/O path name which is a formal parameter to a subprogram cannot be assigned to an unnamed buffer in the subprogram.

Other Secondary Keywords

Using ASSIGN with the secondary keywords discussed in this section requires the IO binary.

Using ASSIGN with BYTE and WORD

The BYTE attribute specifies that all data is to be sent and received as bytes when the I/O path name is used in an ENTER, OUTPUT, PRINT, or TRANSFER statement that accesses a device, file, or buffer, and when the I/O path name is specified as the PRINTER IS or PRINTALL IS device. In a TRANSFER, the attribute of BYTE or WORD associated with the non-buffer I/O path name determines how the data is sent. When neither BYTE nor WORD is specified in any ASSIGN statement for an I/O path, BYTE is the default attribute. Once the BYTE attribute is assigned (either explicitly or by default) to an I/O path name, it cannot be changed to the WORD attribute by using the normal method of changing attributes (see Changing Attributes below); the converse is also true for the WORD attribute. The WORD attribute specifies that all data is to be sent and received as words (in the same situations as with BYTE above). If the interface to which the I/O path is assigned cannot handle 16-bit data, an error will be reported when the ASSIGN is executed; similarly, if the buffer has a capacity which is an odd number of bytes, an error will be reported. If the FORMAT ON attribute is in effect, the data will be buffered to allow sending words. The first byte is placed in a two-character buffer; when the second byte is placed in this buffer, the two bytes are sent as one word. A Null character, CHR$(0), may be sent to this buffer by HP BASIC to force alignment on word boundaries at the following times: before the first byte is sent, before a numeric item is sent with a W image, after an EOL sequence, or after the last byte is sent to the destination. These Nulls may be converted to another character by using the CONVERT attribute (see below). If WORD has been set explicitly, it remains in effect even when the other defaults are restored (see Changing Attributes). The only way to change the WORD attribute is to explicitly close the path name.

Using ASSIGN with CONVERT

The CONVERT attribute is used to specify a character-conversion table to be used during OUTPUT and ENTER operations; OUT specifies conversions are to be made during all OUTPUTs through the I/O path, and IN specifies conversions with all ENTERs. The default attributes are CONVERT IN OFF and CONVERT OUT OFF, which specify that no conversions are to be made in either direction. No non-default CONVERT attribute can be assigned to an I/O path name that currently possesses the FORMAT OFF attribute, and vice versa. CONVERT...BY INDEX specifies that each original character's code is used to index the replacement character in the specified conversion string, with the only exception that CHR$(0) is replaced by the 256th character in the string. For instance, CHR$(10) is replaced by the 10th character, and CHR$(0) is replaced by the 256th character in the conversion string. If the string contains less than 256 characters, characters with codes that do not index a conversion-string character will not be converted. CONVERT...BY PAIRS specifies that the conversion string contains pairs of characters, each pair consisting of an original character followed by its replacement character. Before each character is moved through the interface, the original characters in the conversion string (the odd characters) are searched for the character's occurrence. If the character is found, it will be replaced by the succeeding character in the conversion string; if it is not found, no conversion takes place. If duplicate original characters exist in the conversion string, only the first occurrence is used. The conversion-string variable must exist for as long as the I/O path name (see explanation of the "lifetime" requirement in the preceding section on Using Buffers). Changes made to the value of this variable immediately affect all subsequent conversions which use the variable. When CONVERT OUT is in effect, the specified conversions are made after any end-of-line (EOL) characters have been inserted into the data but before parity generation is performed (if in effect). When CONVERT IN is in effect, conversions are made after parity is checked but before the data is checked for any item-terminator or statement-terminator characters.

Using ASSIGN with EOL

The EOL attribute specifies the end-of-line (EOL) sequence sent after all data during normal OUTPUT operations and when the "L" image specifier is used. Up to eight characters may be specified as the EOL characters; an error is reported if the string contains more than eight characters. The characters are put into the output data before any conversion is performed (if CONVERT is in effect). If END is included in the EOL attribute, an interface-dependent END indication is sent with the last character of the EOL sequence (such as the EOI signal on HP-IB interfaces); however, if no EOL sequence is sent, the END indication is also suppressed. If DELAY is included, the computer delays the specified number of seconds (after sending the last character) before continuing. END and DELAY apply only to devices; both are ignored when a file or buffer is the destination. The default EOL sequence consists of sending a carriage-return and a line-feed character with no END indication and no delay period. This default is restored when EOL is OFF.

Using ASSIGN with PARITY

The PARITY attribute specifies that parity is to be generated for each byte of data sent by OUTPUT and checked for each byte of data received by ENTER. The parity bit is the most significant bit of each byte (bit 7). The default mode is PARITY OFF. No non-default PARITY attribute can be assigned to an I/O path name which currently possesses the FORMAT OFF attribute, and vice versa. The following PARITY options are available:
Option Effect on \Incoming Data Effect on \Outbound Data
OFF No check is performed No parity is generated
EVEN Check for even parity Generate even parity
ODD Check for odd parity Generate odd parity
ONE Check for parity bit set (1) Set parity bit (1)
ZERO Check for parity bit clear (0) Clear parity bit (0)
Parity is generated after conversions have been made on outbound data and is checked before conversions on inbound data. After parity is checked on incoming data, the parity bit is cleared; however, when PARITY OFF is in effect, bit 7 is not affected. If a PARITY attribute is in effect with the WORD attribute, the most-significant bit of each byte of the word is affected.

Using ASSIGN with RETURN

Using ASSIGN with RETURN requires the IO binary. Although RETURN is not an attribute, including it in the list of attributes directs the system to place a code in a numeric variable to indicate the ASSIGN operation's outcome. If the operation is successful, a 0 is returned. If a non-zero value is returned, it is the error number which otherwise would have been reported. When the latter occurs, the previous status of the I/O path name is retained; the default attributes are not restored. If more than one error occurs during the ASSIGN, the outcome code returned may not be either the first or the last error number. If RETURN is the only item in an ASSIGN statement, the default attributes are not restored to the I/O path (see Changing Attributes below). For example, executing a statement such as ASSIGN @Io_path;RETURN Outcome does not restore the default attributes.

Changing Attributes

The attributes of a currently valid I/O path may be changed, without otherwise disturbing the state of that I/O path or the resource(s) to which it is assigned, by omitting the TO resource clause of the ASSIGN statement. For example, ASSIGN @File;FORMAT OFF assigns the FORMAT OFF attribute to the I/O path name @File without changing the file pointers (if assigned to a mass storage file). The only exception is that once either the BYTE or WORD attribute is assigned to the I/O path name, the attribute cannot be changed in this manner; the I/O path name must either be closed and then assigned to the resource or be re-assigned to change either of these attributes. A statement such as ASSIGN @Device restores the default attributes to the I/O path name, if it is currently assigned. As stated in the preceding paragraph, the only exception is that once the WORD attribute is explicitly assigned to an I/O path name, the default BYTE attribute cannot be restored in this manner.

Using ASSIGN With SWAP

The secondary keyword SWAP sets the order in which bytes are transferred for an I/O path assigned with FORMAT OFF. If the ASSIGN statement does not create the I/O path with FORMAT OFF, any SWAP clause in the statement is ignored. The default behavior of ASSIGN is SWAP OFF. When SWAP is OFF, data is transferred by sending the least significant byte first. When SWAP is ON, data is transferred by sending the most significant byte first. SWAP affects only these types of data: Note that no other type of data is handled properly by SWAP. For example, you cannot properly read a long integer (a four-byte integer) into two INTEGER variables with SWAP ON. SWAP is useful in these situations: Suppose you want to send commands to an instrument as strings and receive numeric data from the instrument as unformatted bytes. You also want to read string data from the instrument, such as error messages. You could use this approach: 100 ASSIGN @Device TO Dev_selector 110 ASSIGN @Device_bin TO Dev_selector;FORMAT OFF,SWAP ON 120 OUTPUT @Device;Cmd$ ! Cmd$ contains an instrument command. 130 ENTER @Device_bin;Real_var ! Real_var is a REAL variable. 140 ENTER @Device;Err_msg$ ! Err_msg$ contains an error message string. Suppose you want to read a BDAT file written on a DOS disk by the HP Measurement Coprocessor. These are the statements that wrote the file: 100 INTEGER Int_var 110 CREATE BDAT "MYFILE" 120 ASSIGN @File TO"MYFILE" ! Default for BDAT files is FORMAT OFF. 130 OUTPUT @File;Real_var,Int_var,String$ It is important to note that the default formatting for I/O paths assigned to BDAT files is FORMAT OFF. To read MYFILE with HP BASIC, you must use these statements: 100 INTEGER Int_var 110 ASSIGN @File TO "MYFILE";SWAP ON 120 ENTER @File;Real_var,Int_var,String$

Closing I/O Paths

There are a number of ways that I/O paths are closed and the I/O path names rendered invalid. Closing an I/O path cancels any ON-event actions for that I/O path. I/O path names that are not included in a COM statement are closed at the following times: I/O path names that are included in a COM statement remain open and valid during a LOAD, GET, STOP, END, or simple SCRATCH. I/O path names in COM are only closed at the following times: Additionally, when [Reset] is pressed, all I/O path names are rendered invalid without going through some of the updating steps that are normally taken to close an I/O path. This is usually not a problem, but there are rare situations which might leave file pointers in the wrong state if their I/O path is closed by a [Reset]. Explicit closing is preferred and recommended. When ASSIGN is used to close either the source or destination I/O path name of a currently active TRANSFER, the I/O path is not actually closed until the TRANSFER is completed. When I/O path names are closed in this manner, any pending (logged but not serviced) EOR or EOT events are lost (they do not initiate their respective branches). With buffers' I/O path names, the I/O path name might not be closed until two TRANSFERs (one in each direction) are completed.

HP BASIC/UX Specifics

ASSIGN allows you to use HP-UX piping commands, such as |lp. Assigning an I/O path name to a pipe associates the I/O path with an HP-UX pipe. Outbound pipes allow direction of HP BASIC/UX| output to an HP-UX filter or utility, and inbound pipes allow HP BASIC/UX to read input from an HP-UX filter of utility. The pipe symbol | is used to specify a pipe. If this symbol appears at the beginning of the string (as in |lp) an outbound pipe is opened. If this symbol appears at the end of the string (as in ps -ef| ) an inbound pipe is opened. HP BASIC/UX treats output to a pipe as it would output to a file. The pipe must be explicitly closed before any output becomes permanent (or takes place). Output to a spooled device will not be sent to the spooler until the pipe has been closed. The closing of pipes can be achieved with a subsequent ASSIGN @Pipe to *, QUIT, or SCRATCH command.

Using EXCHANGE and SHIFT IN...OUT

Using ASSIGN with the secondary keywords discussed in this section requires the LANGUAGE binary. Some localized versions of HP BASIC , such as Japanese localized HP BASIC, support two-byte characters. The secondary keyword EXCHANGE allows you to automatically convert internal HP-15 character codes to the codes supported by your two-byte printer. The available choices and default values for the exchange string depend on the particular LANGUAGE localization binary that you are using. You can turn the EXCHANGE function off by specifying EXCHANGE OFF. If you specify EXCHANGE without an exchange string, "HP-16" is assumed. If you are using EXCHANGE with an ASSIGNed file, you must use a file CREATEd with one of the following types: Note that EXCHANGE cannot be used with these combinations of ASSIGN settings: The secondary keywords SHIFT IN and OUT are useful with certain printers that use special control strings to turn two-byte printing on and off. HP BASIC automatically sends the specified shift in string before two-byte characters. HP BASIC also sends the specified shift out string before one-byte characters that follow two-byte characters.
NOTE
SHIFT IN and SHIFT OUT cause Error 257 if used with HP-15 characters. Use EXCHANGE to convert HP-15 characters to your LANGUAGE two-byte characters
For a general discussion of globalization and localization including printers, refer to the HP BASIC Porting and Globalization manual. For LANGUAGE specific details, refer to Using LanguageX withHP BASIC, where LanguageX is your local language.

ATN

Supported On UX WS DOS IN
Option Required None
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes
ATN returns the arctangent of its argument.

Example Statements

Angle=ATN(Tangent)
PRINT "Angle = ";ATN(CMPLX(-1.5,3.5))

Syntax

Item Description/Default Range\Restrictions
argument numeric expression within valid ranges of INTEGER or REAL data types for INTEGER and REAL arguments; see Range Restriction Specifics for COMPLEX arguments and underflow conditions.

Semantics

If the argument is COMPLEX, the value returned is COMPLEX. To compute the ATN of a COMPLEX value, the COMPLEX binary must be loaded. If the argument is REAL or INTEGER, the value returned is REAL. The angle mode (set by RAD or DEG) determines whether the value returned is in degrees or radians. If the current angle mode is DEG, the range of the result is -90 to +90 degrees. If the current angle mode is RAD, the range of the result is -PI/2 to +PI/2 radians. The angle mode is radians unless you specify degrees with the DEG statement.

Range Restriction Specifics

The formula for computing the ATN of a COMPLEX value is as follows: (i/2)*LOG((i+Argument)/(i-Argument)) where i is the COMPLEX value CMPLX(0,1) and Argument is a COMPLEX argument to the ATN function. Some values of a COMPLEX argument may cause errors in this computation. For example, ATN(CMPLX(MAXREAL,MAXREAL)) will cause error 22 (error 21 in HP BASIC/UX 700) due to the computation of (i+Argument)/(i-Argument) ATN is not defined at i and -i and will generate error 623 given those arguments. The principle value, which has a real part between -PI/2 to +PI/2, is returned for COMPLEX arguments. The following range restrictions apply in HP BASIC/UX 700 when underflow mode (CONTROL 32,7;mode) is set to Error or Ignore.
Range Underflow Mode\Error Underflow Mode\Ignore
Positive Maximum +8.18773715074641E+076 +1.79769313486232E+308
Negative Minimum -8.18773715074641E+076 -1.79769313486232E+308
Positive Minimum +1.22133866975546E-077 +4.94065645841247E-3241
Negative Maximum -1.22133866975546E-077 -4.94065645841247E-3242
1 An underflow in Ignore mode results in a denormalized number that is less than the value for +MINREAL. 2An underflow in Ignore mode results in a denormalized number that is greater than the value for -MINREAL.

ATNH

Supported On UX WS DOS
Option Required COMPLEX
Keyboard Executable Yes
Programmable Yes
In an IF ... THEN ... Yes
ATNH returns the hyperbolic arctangent of a numeric expression.

Example Statements

Result=ATNH(-.4571)
PRINT "Hyperbolic Arctangent = ";ATNH(X1)

Syntax

Item Description/Default Range\Restrictions
argument numeric expression -1 through +1 for INTEGER and REAL arguments; see Range Restriction Specifics for COMPLEX arguments and underflow conditions

Semantics

If an INTEGER or REAL argument is given, this function returns a REAL value. If a COMPLEX argument is given, this function returns a COMPLEX value.

Range Restriction Specifics

The formula for computing ATNH is as follows: LOG((1+Argument)/(1-Argument))/2 where Argument is the argument to the ATNH function. Some values of the argument may cause errors in this computation. For example: ATNH(CMPLX(MAXREAL,MINREAL)) will cause error 22 (REAL overflow) (error 21 in HP BASIC/UX 700) due to the divide operation in the formula. Note that the hyperbolicarctangent of a COMPLEX number returns a principle value, that has an imaginary part which falls in the range of -PI/2 to +PI/2. The following range restrictions apply in HP BASIC/UX 700 when underflow mode (CONTROL 32,7;mode) is set to Error or Ignore.
Range Underflow Mode\Error Underflow Mode\Ignore
Positive Maximum +1.00000000000000E+000 +1.00000000000000E+000
Negative Minimum -1.00000000000000E+000 -1.00000000000000E+000
Positive Minimum +2.22507385850720E-308 +4.94065645841247E-324 1
Negative Maximum -2.22507385850720E-308 -4.94065645841247E-3242
1 An underflow in Ignore mode results in a denormalized number that is less than the value for +MINREAL. 2An underflow in Ignore mode results in a denormalized number that is greater than the value for -MINREAL.

AXES

Supported On UX WS DOS
Option Required GRAPH
Keyboard Executable Yes
Programmable Yes
in an IF ... THEN ...Yes
AXES draws a pair of axes with optional, equally spaced tick marks.

Example Statements

AXES 10,10
AXES Xspace,Yspace
AXES Xspace,Yspace,Xlocy,Ylocx,Xmajor,Ymajor,Majorsize

Syntax

Item Description Range
x tick spacing numeric expression in current units; Default = 0, no ticks(see text)
y tick spacingnumeric expression in current units; Default = 0, no ticks(see text)
y axis locationnumeric expression specifying the location of the y axis in x-axis units; Default = 0--
x axis locationnumeric expression specifying the location of the x axis in y-axis units; Default = 0--
x major countnumeric expression, rounded to an integer, specifying the number of tick intervals between major tickmarks; Default = 11 (every tick is major)1 through 32 767
y major countnumeric expression, rounded to an integer, specifying the number of tick intervals between major tick marks; Default = 1 (every tick is major)1 through 32 767
major tick sizenumeric expression in graphic display units; Default = 2 --

Semantics

Tick marks are positioned so that a major tick mark coincides with the axis origin, whether or not that intersection is visible. Both axes and tick marks are drawn with the current line type and pen. Minor tick marks are drawn half the size of major tick marks. The X and Y tick spacing must not generate more than 32 768 tick marks in the clip area (including the axis), or error 20 will be generated.
Applicable Graphics Transformations
Scaling PIVOT CSIZE LDIR PDIR
Lines (generated by moves and draws) X X [4]
Polygons and rectangles X X X X
Characters (generated by LABEL) X X

Axes (generated by AXES and GRID)X

Location of labels[1] [3] [2]

1The starting point for labels drawn after lines or axes is affected by scaling. 2The starting point for labels drawn after other labels is affected by LDIR. 3The starting point for labels drawn after lines or axes is affected by PIVOT. 4RPLOT and IPLOT are affected by PDIR.