PosCpo
Displays the field's position in current line in GetDados function, in positions 3, 4 and 6, which respectively are Measurements, related Nonconformances, and associated Instruments. There are two ways to use the positions stored in the aResultados vector:
1. | Conventional use of aHeader and aCols vectors, or search of field in aHeader, saving position referent in aCols, as long as one of the 3, 4 or 6 options is being edited. |
Example:
nPosmed := Ascan(aHeader,{|x|AllTrim(x[2])==\"QES_MEDICA\"})
2. | Directly on aResultados vector structure: |
There is a aSavHeadEns public vector, which stores only the aHeader structure used in the measurements, according to the lab selected test, that is, only position 3 of the aResultados vector. Such vector's existence and use is justified due to the chart used for each test, where aHeader and aCols are dynamically assembled.
To search a test X collected measurement's field position, with no need to be in the measurements' routine, proceed as follows:
aHeaderTmp := aSavHeadEns[nFldLab,nFldEns]
nPosmed := Ascan(aHeader,{|x|AllTrim(x[2])==\"QES_MEDICA\"})
cResMed := aResultados[nFldLab,3.nFldEns,Z,nPosMed]
//where Z is the stored Getdados function's line.
The above example demonstrates how we can place a field in the aResultados vector outside the GetDados function. In this example, the nFldLab and nFldEns public variables respectively indicate the current lab's and the selected test's positions. Observe that the aResultados vector stores a precise copy of aCols edited in the GetDados and/or Enchoice functions.
To find the position of a field edited in the 4 and 6 positions, the aHeader is stored in the aSavaHeader vector, where it has two dimensions respectively storing structures regarding: Nonconformances and Instruments
Example:
aHeaderNco := aSavaHeader[1] //nonconformances
aHeaderIns := aSavaHeader[2] //instrumentos
|
To reference a field's position in the Enchoice function (Lab and Final Report), position 7 in the aResultados[PosLab....], and position 1 in the aResultados[nPosLauFin...], search the name of the field to be manipulated in the aCpoEnc public vector.
Example:
//Lab Report
nPosLau := Ascan(aCpoEnc,{|x|AllTrim(x)==\"QEL_LAUDO\"})
cLaudo := aResultados[nFldLab,7.nPosLau]
To reference the field via standard customization through the SX3, per validation, pre-validation, or trigger, just use the memory variable.
Example:
M->QEL_LAUDO := \"A\"
...
|