04-08-2005 08:57 AM
04-08-2005 12:03 PM
Dim data() As String, datapoints As Integer, scancount As Integer, delta As Double
Dim textToParse as string
Private Sub cmdGetData_Click()
CWGPIB1.Write "OT"
Text4.Text = CWGPIB1.Read
textToParse = Text4.Text
End Sub
Private Sub cmdParseString_Click()
data = Split(textToParse , ",")
datapoints = CInt(data(0))
scancount = CInt(data(1))
delta = CDbl(data(2))
End Sub
data
needs to be an array of strings for the Split function to workdelta
needs to be a Double in order for you to maintain accuracy. Long variables truncate decimal points.textToParse
may not be necessary, but I used it to make sure that I didn't have any trouble with getting the data.Split
takes a string and creates an array of strings depending on the delimiter chosen, which in this case is ",".CInt
converts a string into an integer.CDbl
converts a string into a double.04-18-2005 04:01 AM
04-19-2005 08:25 AM