Specifications

192 Chapter 8
Save and Recall Files
Example Programs for Saving/Recalling a File
2340 file = InputBox(msg, "file name")
2350 If file = "" Then GoTo input_end
2360 file = """" & file & """"
2370 msg = "file name : " & file & vbCrLf & vbCrLf & "Do you
want to change the file name again?"
2380 ans = MsgBox(msg, vbYesNo)
2390 If ans = vbNo Then
2400 SCPI.Output "*CLS"
2410 SCPI.Output "MMEM:STOR:CITI" & CStr(model) & " " & file
2420 SCPI.Output "SYST:ERR?"
2430 SCPI.Enter err_no, "#"
2440 SCPI.Enter err_mes
2450 If err_no <> 0 Then
2460 MsgBox (err_mes & "occured")
2470 GoTo input_name
2480 ElseIf err_no = 0 Then
2490 MsgBox ("save done")
2500 End If
2510 ElseIf ans = vbYes Then
2520 GoTo input_name
2530 End If
2540 input_end:
2550 End Sub
2560
2570 Private Sub save_graphics()
2580 Dim msg As String, file As String, file_type As String
2590 Dim err_mes As String, bool As String
2600 Dim err_no As Integer
2610
2620 msg = "Select the File type, BMP or JPEG." & vbCrLf &
vbCrLf & "Input the first letter of a word [B/J]"
2630 file_type = InputBox(msg, "file type")
2640 If file_type = "" Then GoTo input_end
2650
2660 input_name:
2670 msg = "Input the graphics file name without extension you
wish to save."
2680 file = InputBox(msg, "file name")
2690 If file = "" Then GoTo input_end
2700 file = """" & file & """"
2710 msg = "file name : " & file & vbCrLf & vbCrLf & "Do you
want to change the file name again?"
2720 ans = MsgBox(msg, vbYesNo)
2730 If ans = vbNo Then
2740 SCPI.Output "*CLS"
2750 If UCase(file_type) = "B" Then
2760 SCPI.Output "MMEM:STOR:GRAP:BMP " & file
2770 ElseIf UCase(file_type) = "J" Then
2780 SCPI.Output "MMEM:STOR:GRAP " & file
2790 End If
2800 SCPI.Output "SYST:ERR?"
2810 SCPI.Enter err_no, "#"
2820 SCPI.Enter err_mes
2830 If err_no <> 0 Then
2840 MsgBox (err_mes & "occured")
2850 GoTo input_name
2860 ElseIf err_no = 0 Then
2870 MsgBox ("save done")