Specifications
Automation 2-59
2-59
For num = 1 To nPipes
rSquared = pipeSizes(num) * pipeSizes(num)/144.0/
4.0
Mach = flowValue / pi / rSquared / soundVel
sizetxt = Format(pipeSizes(num),
"###,###,###.###")
Machtxt = Format(Mach, "###,###,###.#####")
DispText(num + 1) = Format$(sizetxt,
"@@@@@@@@@@@@@@@") + " " +
Format$(Machtxt, "@@@@@@@@@@@@@@@")
Next num
For each pipe size, the Mach
number is calculated,
formatted and stored in the
previously created array of
strings.
Please notice that there are
eighteen spaces between
the quotation marks in the
sixth line of code (ninth line
displayed).
Begin Dialog UserDialog 360,217
ListBox 10,49,340,133,DispText(),.Field5
OKButton 250,189,90,21
Text 30,14,150,14,"Speed of Sound (ft/s):",
.Field2
TextBox 190,14,90,21,.Field1
End Dialog
Dim dlg2 As UserDialog
dlg2.Field1 = soundVelTxt
Dialog dlg2
End
Create a user property view
that displays the Speed of
Sound value as well as the
Mach number for each of
the pipe sizes.
Use the Language Help
option provided in the Help
menu to explore the use of
UserDialogs.
NoFlow:
MsgBox "Unknown mass flow in stream " + strm.name
End
NoRho:
MsgBox "Unknown density in stream " + strm.name
End
NoCv:
MsgBox "Unknown heat capacity in stream " +
strm.name
End
NoZ:
MsgBox "Unknown compressibility in stream " +
strm.name
End
NoTemp:
MsgBox "Unknown temperature in stream " +
strm.name
End
NoMolWt:
MsgBox "Unknown molecular weight in stream " +
strm.name
End
This is where you define the
error trap instances.
End Sub
Signifies the end of the
method.
Code Explanation