(Page 2 of 5 in this chapter)


CONVERT

Description

Converts a substring to a value which is used as either a message number to append to the output list of messages, or as a label to which to jump.

The message number or label is constructed by first subtracting subval from the input string and then adding baseval to the result. If the input string is to be treated as an integer, as many as five digits will be used. If the input string is to be treated as a character string, the first character will be used, as will the first character of subval. By default, the input string and subval are treated as integers. If the keyword CASE or NOCASE is used, they will be treated as characters.

If a message number is generated, it is appended to the end of the output list. If the EXIT keyword is specified, processing returns to the line following the command which called this one. If the EXIT keyword is not specified, processing resumes at the next line in the prompt rules table.

If a GOTO label is generated, processing continues with the command at the computed label.

If a CALL label is generated, processing continues with the command at the computed label. When control is returned, processing resumes to the next line in the prompt rules table.

Command Specification

CONVERT [CASE|NOCASE] subval [MESSAGE|CALL|GOTO]
baseval [EXIT|CONT]

CASE Do a case sensitive character subtract.

NOCASE Do a case insensitive character subtract. This is the default.

subval Integer or character to subtract from the string.

MESSAGE Generate and append a message number to the output list.

CALL Generate a label to call as a subroutine.

GOTO Generate a label to which to jump. This is the default.

baseval The base label or message number to use.

EXIT Return after MESSAGE.

CONT Continue when done (MESSAGE). This is the default.

Note: EXIT and CONT apply only if [MESSAGE] is used.

Examples

TEN = 30        ;message number to say TEN.
CONVERT 1 MESSAGE TEN ;subtract 1 from passed digit
;and add to label value TEN,
;output resulting message
;number then goto next cmd.
;Note that case 0 is ruled out
;beforehand.
LETTERA = 60 ;message number for letters
;'a' - 'z'
CONVERT NOCASE "A" MESSAGE LETTERA
;convert letters to appropriate
;message number
CONVERT 0 GOTO PLACE
;say first, second etc.


(Page 2 of 5 in this chapter)


tech_support@nmss.com
Copyright © 1999, Natural MicroSystems, Inc. All rights reserved.