Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Intermec Online Guide - <b>define numeric (d)</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
DEFINE NUMERIC (D)

Purpose: Define numeric register as equal to contents of another numeric
         register, to al literal number, or to an arithmetic argument.

Format:  Dn1 = {1}

Remarks: D         Define

         n1        Numeric register

         {1}       Select one of the following:

                   n2 numeric register or literal number

                   Expression:         Function:

                   Dn1 = n2            Copy n2 to n1

                   argument  arithmetic functions ( - * / + )

                   Expression:         Function:

                   Dn1 = n2 + n3       Add n2 and n3

                   Dn1 = n2 * n3       Multiply n2 by n3

                   Dn1 = n2 / n3       Divide n2 by n3

                   Dn1 = n2 - n3       Subtract n3 from n2

                   Dn1 = [n4]          Get length of n4

                   n2 & n3 = numeric register or literal.
                   Number n4 = file record or string register.

         Argument            Limitations

         Addition (+)        Max. returned sum is 9999999.
         Multiplication (*)  Maximum product is 9999999.
         Subtraction (-)     Negative results are returned as 0.
         Division (/)        Division by 0 returns 9999999.

         The commands DA(1) = #1 and D#1 = A(1) are invalid.  A numeric
         register cannot be copied into a file record (or vice versa)
         unless the Convert (C) Command is used.


Examples:          If:                 And:                Then:

                 Dn1 = n2

                   D#0 = 10            #0 = 25             #0 = 10

                   D#0 = #1            #1 = 25             #0 = 25

                 Dn1 = Argument

                 Addition:

                   D#0 = #1 + #2       #1 = 10   #0 = 25
                                       #2 = 15

                   D#0 = #1 + 50       #1 = 10             #0 = 60

                 Multiplication:

                   D#3 = #4 * #5       #4 = 3              #3 = 18
                                       #5 = 6

                   D#6 = #2 * 50       #2 = 10             #6 = 500

                 Subtraction:

                   D#2 = #3 - #1       #3 = 5              #2 = 3
                                       #1 = 2

                   D#3 = #5 - 20       #5 = 25             #3 = 5

                   D#8 = 50 - #4       #4 = 30             #8 = 20

                 Division:

                   D#5 = #3 / #8       #3 = 5              #2 = 3
                                       #1 = 2

                   D#3 = #2 / 20       #2 = 40             #3 = 2

                   D#9 = 20 / #4       #4 = 10             #9 = 2

                   D#1 = #2 / #3       #2 = 10             #1 = 3
                                       #3 = 3

                 Length:

                   D#1 = [$0]          $0 = "TEST"         #1 = 4

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson