Capítulo II: Algoritmos de pre y post-proceso para la generación de nubes de puntos y la visualización de
2.4 Generación de nubes de puntos para superficies y volúmenes, algoritmo de rellenado de
._
TOTAL PURMASES: $._
LAST PURQUiSE:_J_J_
Data in < > can be used to FIND vendors
l*
OPEN VENDOR
//
allfiles
must be opened. ENTER VENDOR//
inltalize enter macro.AUTOPAGE FORM
//
automatically assign windows ENTRY VENDOR.RECNUM {NOPUT,AUT0FIND}//
Translatiom Do data entry with the record number of the vendorfile
//
automat1ca11y find record, do not update the record buffer since//
record number can't be changed. ENTRY VENDOR. VENDOR//
Translation, Do standard data entry on the vendor name of the vendorfile.
ENTRY VENDOR.ADDRESSENTRY VENDOR.CITY ENTRY VENDOR.STATE ENTRY VENDOR.ZIP ENTRY VEND0R.NONE_AC ENTRY VENDOR. PHONE
_
EXOlG ENTRY VENDOR.FHONE
_NUMBER
ENTRY VENDOR.TERMS ENTRY VENDOR.CREDIT_ LIMIT
ENTRY VENDOR.CREDIT _USED {DISPLAYONLY}
//
Translation, When the vendorfile
is FOUND, display credit used in this//
window.ENTRY (FORM.II-FORM.12) {DISPLAY0NLY}
//
Translation, When a record is founch display the result of the calculation//
of creditlimit
(FORM.II) minus credit used (FORM.12) fn this window. ENTRY VENDOR.PURMASES {DISPLAY0NLY}ENTRY VENDOR.LAST_PURMASE {DISPLAYONLY}
RETURN
//
return from entry sectionENTEREND
//
end of enter cormandABORT
//
stop after escape key.//
note: the entry command can only be used inside an enter or entergroup KEYPROC KEY.USER//
Define action of user defined keyOUTPUT FORM
//
Output the pageENTAGAIN
//
Return to same windowRETURN
———————
DataF1ex 2.0 User's Manual SAMPLE APPLICATIONS C-81
————— —
Notice the similarity between this
file
and the one for CUSTOMERS. Each ENTRY connand line links a data base field with a WINDOW. Close to the bottom. we see something new: ENTRY (F0RM.I1-F0RM.12).This is a calculated field that translates to:
WHEN DISPLAYING FILE 21, SUBTRACT THE VALUE OF WINDOW 12 (FORM.12) FROM THE VALUE OF WINDOW
li
(FORM.ll) AND PUT THE RESULT IN WINDOW 13.There is not a report for the vendor
file
supplied with the sampleconfigurations; this one is up to you. Create a report format for
VENDOR and use the CUSTOMER report as a model. After making the
report, add
it
to the MENU using the MENUDEF program.After.making your reportg try your hand at a simple
file
definition and configuration using the AUTODEF Program. AUTODEF takes a screen IMAGE format created with a text editor and makes both thefile
definition and compilable configuration
file
fromit.
After making thesep look at thefile
definition with the FILEDEF program and typeout the configuration with the operating system TYPE command. Then
compile the configuration. THE INVENTORY FILE:
With the inventory
file
we start to see the true power of DataF]ex.Each inventory part is supplied by a VENDOR, so the INVENTORY
file
issaid to RELATE to the VENDOR
file.
When an inventory part is found(called into memory), the RELATED VENDOR record automatically comes
with
it.
This relationship is automatically maintained by DataFlex.DATA ACCESS CORPORATION INVENTORY MASTER FILE
—————— VENDOR NUNBER:
_
.NAME: VENDOR PART ID:
YOUR PART ID: DESCRIPTION: STOCK QUANTITY: . MINIMUM QUANTITY: . REORDER QUANTITY: . QTY ON ORDER: . SALES/MONTH: $ .
_
SALES/YEAR: $._
PROFIT/YEAR: $._
LIST PRICE: $._
WHOLESALE PRICE: $._
AVERAGE COST: $ ._
STOCK VALUE: $._
——————— —C-82 SAMPLE APPLICATIONS DataFlex 2.0 User's Manual
— —————
— ————————————
When running the inventory data entry screen, the
first
two fields areactually out of the VENDOR
file.
You can find the vendor of interest on this screen by either keyp just like you could in the VENDORscreen. You can then move the cursor down to VENDOR PART ID: to find
the
first
(or any) part for that vendor. The vendor number and thenvendorG part number make up a "two segment key", that is, you must
find the vendor, then, put in all or part of the vendors part number
to find a record by that index. To find the
first
part for any vendor, enter the VENDOR NUMBER or NAME andhit
the "SUPERFINO" key. The INVENTORYfile
is also indexed (able to find records by) "YOUR PART ID" and "DESCRIPTION". You can put the cursor in any of these windows and find a particular parttWhen you are creating a new partg find the vendor firstp then
fill
Inthe other windows like you did in the other screens. This configura-
tion will also allow you to create new vendors from this inventory
screen. Just enter a new vendor name with no vendor number, and when you SAVE the partg a new vendor will be created. Later we
will
see how to disable this featureif
you want.DataF1ex 2.0 User's Manual SAKPLE APPLICATIONS C-83
INVENTORY FILE DEFINITION:
FILE DEFINITION LISTING FOR FILE #22
***************************************************
FILE ROOT NAME = INVT
USER DISPLAY NAME = INVENTORY FILE SHORT NAME = INVT
***************************************************
RECORD LENGTH - 128 (USED = 104) MAX NUMBER OF RECORDS = lOó (USED = 33) DELETED SPACE IS REUSED
MULTI-USER RE-READ ACTIVE
***************************************************
FIELD FIELD FIELD FIELD DEC MAIN RELATES--TO NMBR OFFSET LEN TYPE PTS INDEX FILE FIELD
---
————-— -—--- -—-—----
-——-- -—-— -—---I
l
2 NUMERIC Ol
21 O VENDOR2 3 15 ASCII
l
O O VENDOR PART_ID3 18 15 ASCII 2 O O PART_ID 4 33 35 ASCII 3 O O DESCRIPTION 5 68 3 NUMERIC O O O O QUANTITY 6 71 2 NUMERIC O O O O MINIMUM 7 73 3 NUMERIC O O O O REORDER 8 76 3 NUMERIC O O O O ON_0RDER 9 79 5 NUMERIC 2 O O O SALES_M0NTH
10 84 5 NUMERIC 2 O O O SALES YEAR
II
89 4 NUMERIC 2 O O O PR0FIT_YEAR12 93 4 NUMERIC 2 O O O LIST_PRICE
13 97 4 NUMERIC 2 O O O WH0LESALE_PRICE
14 101 4 NUMERIC 2 O O O AVG_C0ST
INDEX
l:
FIELD SEGMENTS: <1> <2> INDEX 2: FIELD SEGMENTS: . <3>INDEX 3: FIELD SEGMENTS: <4> <0>
The
first
field "VENDOR NUMBER" RELATES to the record number(field
zero) of the vendor
file
(#21). This is all that's required to RELATEthe inventory
file
to the vendorfile
andit
essentlaily makes the vendorfile
a logical extension of the inventoryfile.
The INVENTORY
file
has THREE indexes. Thefirst
index is by vendor number (field one) AND vendor part id (field two). This combining offields to make one index is called a multi-segment index. Since
record number is NOT appended to this index, two parts Cáñft have the same vendor AND part number, which would be a duplicate record.
Index TWO is on field 39 or YOUR PART ID, a1lowing the same part to be known by two different part numbers, yours and the vendoMs. Could two parts have the same part number?
If
notp how could you allow thatif
you wanted? Answer: No, two parts could not have the same number, butif
they coulcb the circumstance couldstill
be dealt witheffectively by appending field ZERO (the record number) to the indem
rendering the composite index entry unique despite the duplication. Index THREE allows access by DESCRIPTION. Notice the "MAIN INDEX" column of the
file
definition. The main index is the number of theC-84 SAMPLE APPLICATIONS DataFlex 2.0 User's Manual
index that will be used when you FIND by that
field.
In thisfile
there are no fields that are used in more than one index, but where
there are9 the main index becomes important.
THE INVENTORY ENTER CONFIGURATION: (some lines are deleted from the image area to conserve space) IFORM
DATA ACCESS CORPORATION INVENTORY MASTER FILE
VENDOR NUMBER: <
_
.> NAME: < >VENDOR PART ID:<
'
YOUR PART ID: < > DESCRIPTI0N: <
'
STOCK QUANTITY: . MINIMUM QUANTITY: _. REORDER QUANTITY: . QTY ON ORDER: SALES/MONTH: $._
SALES/YEAR: $._
PROFIT/YEAR: $._
LIST PRICE: $._
WHOLESALE PRICE: S._
AVERAGE COST: $._
STOCK VALUE: $._
l*
//
This enter configuration is alittle
more sophisticated sinceit
deals//
with twofiles.
The inventoryfile
RELATES to the vendorfile.
OPEN INVT//
Allfiles
must be OPENED before use. OPEN VENDOR//
The order of opening thefile
Is//
not important.ENTER INVT VENDOR
//
ENTERwill
maintain both INVT and VENDOR.//
Since INVT relates TO VENDORit
MUST be// first
on the ENTER line.//
INVT is the mainfile.
AUTOPAGE FORM
//
Set up to automatically assign windows.//
These fields use the AUTOPAGE option--the windows are automatically//
assigned to the FORM page.ENTRY VENDOR.RECNUM {AUTOFIND}
//
Translation, do data entry on the record number of the vendorfile.
//
Automatically try to find the vendor by number.//
Note that the element of the related TOfile
is used here//
and automatically PUT to the VENDOR field of the INVT ff1e.//
The related TO element should always be used in a case like this. (This configuration is continued on the next page.)DataF1ex 2.0 User's Manual SAMPLE APPLICATIONS C-85 ————— ENTRY VENDOR.VENDOR {SKIPF0UND,FINDRECL}
//
Translation, Do data entry on the vendor name of the vendorfile
//
Skip this entryIf
a record has already been found and REQUIRE//
that a vendor be found to continue.ENTRY INVT.VEND0R_PART_ID {SKIPF0UND,RETAIN}