Trail: PROIV Documentation > Developer > PROIV Developer > Developing Functions > Events and Logic > CONV

 

 

Purpose

CONV converts data from alphanumeric to numeric, or vice versa, with no editing.
 

Syntax

variable = CONV(operand)
 

Operation

operand is any valid numeric or alphanumeric constant, variable, or expression. 
variable is a alphanumeric or
numeric scratch or file variable  
 

Remarks

operand is checked for valid alpha characters (A-Z), numeric characters (0-9), sign character (+ or -), and decimal point (.).

Any other characters result in the operation not being done, and the contents of the receiving field being left unchanged.


For a numeric to alphanumeric conversion the value returned is the string value of the operand with a leading minus sign.
 

Example

Assume  #A = 100.85,  #B = 32,  $X = ‘ABC’,  $Y = ‘1346.99-‘
SEQ-NO is an alphanumeric file variable with a maximum length of 3
CUSTNO is a numeric file variable with a maximum length of 8.

#MAX = CONV($Y)..........sets #MAX to 1346.99-
$XDATEA = CONV(#A)....sets $XDATEA to ‘100.85’
SEQ-NO = CONV($X)...... is invalid because SEQ-NO and the operand ($X) are of the same data type – alphanumeric

SEQ-NO = CONV(CUSTNO) results in the following values:

CUSTNO value
   SEQ-NO value
    12                        ‘12’
    800531                 ‘800’
    1                          1’
    0                          ‘’
    321-                     ‘-32’
    12.345                  ‘12.’
    1234.56                ‘123’

CUSTNO = CONV(SEQ-NO) results in the following values:

SEQ-NO value
      CUSTNO value
   ‘123’                      123
    ‘1’                         1
    ‘1.3’                      1.3
   ‘83-‘                      83-
    ‘X33’                     unchanged
 

Comment on this topic

Topic ID: 520033

 
 
 

Table of Contents

Index

Glossary

-Search-

Back