Specifications
Chapter 8 191
Save and Recall Files
Example Programs for Saving/Recalling a File
8. Save and Recall Files
1810 ElseIf err_no = 0 Then
1820 MsgBox ("save done")
1830 End If
1840 ElseIf ans = vbYes Then
1850 GoTo input_name
1860 End If
1870 input_end:
1880 End Sub
1890
1900 Private Sub recall_data()
1910 Dim msg As String, file As String, err_mes As String
1920 Dim err_no As Integer
1930
1940 input_name:
1950 msg = "Input the binary data file file name without
extension you wish to recall."
1960 file = InputBox(msg, "file name")
1970 If file = "" Then GoTo input_end
1980 file = """" & file & """"
1990 msg = "Do you want to change the file name again?"
2000 ans = MsgBox(msg, vbYesNo)
2010 If ans = vbNo Then
2020 SCPI.Output "*CLS"
2030 SCPI.Output "MMEM:LOAD:TRAC " & file
2040 SCPI.Output "SYST:ERR?"
2050 SCPI.Enter err_no, "#"
2060 SCPI.Enter err_mes
2070 If err_no <> 0 Then
2080 MsgBox (err_mes & "occured")
2090 GoTo input_name
2100 ElseIf err_no = 0 Then
2110 MsgBox ("recall done")
2120 End If
2130 ElseIf ans = vbYes Then
2140 GoTo input_name
2150 End If
2160 input_end:
2170 End Sub
2180
2190 Private Sub save_citi()
2200 Dim msg1 As String, msg2 As String, msg3 As String, msg4
As String
2210 Dim file As String, model As String
2220 Dim err_mes As String, bool As String
2230 Dim err_no As Integer
2240
2250 input_name: '
2260 msg1 = "Select the model of the CITIfile as follows
[1-3];" & vbCrLf & vbCrLf
2270 msg2 = "1: 1 port" & vbCrLf
2280 msg3 = "2: 2 port Series" & vbCrLf
2290 msg4 = "3: 2 port Shunt"
2300 model = InputBox(msg1 & msg2 & msg3 & msg4, "CITIfile
type")
2310 If model = "" Then GoTo input_end
2320
2330 msg = "Input CITIfile name without extension you wish to
save."