Envio de variáveis para saída usando o código DMIS
Da wiki ArcoWiki
This code example is used to send a calculated variable to output applying a tolerance as it was a measured feature.
$$
$$Section 1: Preparing the Variable, this is to be substituted by an actual calculation of the required variable
DECL/DOUBLE,NominalValue,MeasuredValue,DeviationNominalValue=ASSIGN/10MeasuredValue=ASSIGN/10.5Deviation=ASSIGN/MeasuredValue-NominalValue
$$
$$
$$Section 2: Preparing the tolerances
DECL/DOUBLE,utol,ltolutol=ASSIGN/0.1ltol=ASSIGN/-0.1DECL/DOUBLE,ootDECL/CHAR,200,msgIF/(Deviation.GT.utol)oot=ASSIGN/Deviation-utol
ENDIFIF/(Deviation.LT.ltol)oot=ASSIGN/Deviation-ltol
ENDIFmsg=ASSIGN/STR(oot,13,4)
$$
$$
$$Section 3: Creating the output string with formatting
DECL/CHAR,500,strOut,strout1strout1=ASSIGN/'LABEL NOMINAL ACTUAL DEVIATION LOWER TOL. UPPER TOL. OOT'strout=ASSIGN/CONCAT('DIST ',STR(NominalValue,14,4),STR(MeasuredValue,14,4),STR(Deviation,14,4),STR(ltol,14,4),STR(utol,14,4),msg)
$$
$$
$$Section 4: Sending to Output
TEXT/OUTFIL,strout1TEXT/OUTFIL,strout
$$