Comments In A Script; Data Storage; Data Coding - Monarch 9460 Programmer's Manual

Adk printer
Hide thumbs Also See for 9460:
Table of Contents

Advertisement

C o m m e n t s i n a S c r i p t
You must precede comments by a semicolon. The software treats them as a single white space and
ignores them.
;*********************************************************
;*
;* Description
;* This is the main entry point of
;* the script.
;* then starts processing.
;*
;*********************************************************
D a t a S t o r a g e
Although you can define a buffer field as being numeric or alphanumeric, the printer stores both
kinds of data as ASCII characters, as follows:
Data Type
Alphanumeric
Numeric
D a t a C o d i n g
To streamline the amount of data you store or pass to and from the printer, you can encode the data.
For example, you could encode a number as high as 255 by storing the corresponding character from
the ASCII chart. For example, 91 (a two-byte character string, according to printer data storage
rules) could appear as [, the ninety-first character on the ASCII chart.
There are two commands you can use in your script when encoding and decoding data according to
this method.
Command
ASC
CHR
Consider the following code sample.
DEFINE TEMPORARY, QTY1, 3, A
DEFINE TEMPORARY, QTY2, 3, N
MOVE "}", QTY1
ASC QTY1, QTY2
INC QTY2
CHR QTY2, QTY1
This sample demonstrates how to decode a number, use the number in a computation, and encode
the result back to a character.
4-4 Program Structure
Gets the Date and
Description
Sequences of any ASCII characters.
Sequences of numeric ASCII characters. For example, the printer
stores 91 as the two-byte alphanumeric string "91."
Description
Takes an ASCII character and returns the number corresponding to
it on the ASCII chart.
Takes a number from 0-255 and returns the corresponding
character on the ASCII chart.
; Alpha Temp. field
; Numeric Temp. field
; Now contains "}"
; Decodes "}" to 125
; Increments 125 to 126
; Encodes 126 to "~"

Advertisement

Table of Contents
loading

Table of Contents