![PSC PT Program Generator Скачать руководство пользователя страница 140](http://html1.mh-extra.com/html/psc/pt-program-generator/pt-program-generator_user-manual_1622614140.webp)
PPG Tutorial
128
PT Program Generator (PPG) v5.0
Creating and Using Templates
The programs you've worked with so far handle singular information: You
scan or enter one code at a time, and the data is stored one entry per line. But
suppose you wanted to collect sets of different types of data. If you were taking
inventory, for example, rather than scanning each item in a group of identical
products, you might want to scan only one of them and then use the data keys
to record the number of items in the group.
You could add another
Input
node to the
Collect Data
frame of your program
to store the types of data in different registers, but the data file you would end
up with would have code numbers and quantity numbers on alternate lines, as
in the following:
3849293
5
9385834
12
9848495
8
This arrangement of data would be difficult for an inventory or database pro-
gram to interpret. Most programs expect to see related values on the same line,
as in the following:
3849293, 5
9385834, 12
984849, 8
In this arrangement, each line is referred to as a
record,
and each item on the
line is called a
field.
The database program can be set up to treat the first field
as an inventory code and the second as a quantity value.
The way you tell a portable program to arrange data as fields in records is with
a
template
. A template defines the structure used to access data. Most often, a
template is used to combine values from two different registers as fields in a
single register. The fields are either set to a fixed length (so that they appear in
columns in the data file), or they are allowed a variable length with a separator
(such as a comma) separating them. However, you can also use a template to
break apart data stored in a register into separate fields.
You will incorporate a template into the
TUTORIAL
program to collect and
store quantity values along with each item number. To do this, you'll add the
following new nodes to the existing
TUTORIAL
program:
2342.book Page 128 Thursday, July 22, 2004 8:35 AM
Содержание PT Program Generator
Страница 1: ...PT Program Generator User s Manual 2342 book Page 0 Thursday July 22 2004 8 35 AM...
Страница 16: ...Introduction 4 PT Program Generator PPG v5 0 NOTES 2342 book Page 4 Thursday July 22 2004 8 35 AM...
Страница 34: ...PPG Application Design 22 PT Program Generator PPG v5 0 NOTES 2342 book Page 22 Thursday July 22 2004 8 35 AM...
Страница 60: ...The PPG Menubar 48 PT Program Generator PPG v5 0 NOTES 2342 book Page 48 Thursday July 22 2004 8 35 AM...
Страница 88: ...Creating Using Nodes 76 PT Program Generator PPG v5 0 NOTES 2342 book Page 76 Thursday July 22 2004 8 35 AM...
Страница 174: ...The PPG Library 162 PT Program Generator PPG v5 0 NOTES 2342 book Page 162 Thursday July 22 2004 8 35 AM...
Страница 180: ...ASCII Hex Conversion Table 168 PT Program Generator PPG v5 0 NOTES 2342 book Page 168 Thursday July 22 2004 8 35 AM...
Страница 194: ...Glossary 182 PT Program Generator PPG v5 0 NOTES 2342 book Page 182 Thursday July 22 2004 8 35 AM...
Страница 203: ...2342 book Page 191 Thursday July 22 2004 8 35 AM...