I posted a code example to illustrate TF02014877. I removed the files quickly after I got the idea that posting the lic file might not be opportune. Unfortunately, I cannot find this example. But it's possible that Sandra has this example since she reproduced TF02014877. But there the type conversion has to be added (at the end of ReadSeries, just before the last "next" statement).
In the moment I'm a little bit under pressure and have not time enough to prepare such an example. Otherwise you could use this ReadSeries procedure and substitute the values read from file by fixed values:
Code: Select all
Function ReadSeries() As Boolean
ReadSeries = False
Dim s As String
Dim s1 As String
Dim s2 As String
Dim s3 As String
Dim LegendText As String
Dim ii As Integer
Dim Left As Integer
Dim Top As Integer
Dim Bottom As Integer
Dim Right As Integer
Dim PointCount As Integer
Dim d As Double
Dim b As Boolean
Dim bt As Byte
Dim PointShape As Integer
Dim DrawLine As Boolean
Dim CustomLegend As Boolean
'Dim LineWidth As Boolean
Dim DrawPoints As Boolean
'Dim PointSize As Integer
Dim PointColorR As Integer
Dim PointColorG As Integer
Dim PointColorB As Integer
Dim LineColorR As Integer
Dim LineColorG As Integer
Dim LineColorB As Integer
'Dim MyChildWindow As MyChildWindow = Graph.Parent
'MyStreamReader.BaseStream.Position = MyXYF_Information.Positions(0).Series
If Ver > 110 Then
s = ReadString()
If "Serien" <> s Then Return False
End If
'OldSeriesCount:=graph.SeriesCount;
'for i:=1 to SeriesCount do begin
Dim MyFunctions As New MyFunctions
Dim X As Double = Nothing
Dim Y As Double = Nothing
Dim i As Integer
Dim RTFString As String = ""
For i = 0 To SeriesCount - 1
'Dim SeriesName As String = MyFunctions.GetSeriesName(Graph, "tmpSeriesFromOldXYFFile")
Dim NewSeries As New Steema.TeeChart.Styles.Line(Graph.Chart)
'Folgende Deklarationen (hat so funktioniert) wurden aus der Schleife heraus verschoben...
'Dim X As Double = Nothing
'Dim Y As Double = Nothing
' series:=Graph.Series[0];
' read:=read+fs.read(b, sizeof( Boolean )); *******
b = MyStreamReader.ReadBoolean
' Series.Active:=b;
' read:=read+fs.read(cl, sizeof( TColor ));
ii = MyStreamReader.ReadInt32
' Series.BoundsColor:=cl;
' read:=read+fs.read(ps, sizeof( TPenStyle ));
bt = MyStreamReader.ReadByte
' Series.BoundsLineStyle:=ps;
' read:=read+fs.read(ii, sizeof( integer ));
ii = MyStreamReader.ReadInt32
' Series.BoundsWidth:=ii;
' read:=read+fs.read(b, sizeof( boolean ));
b = MyStreamReader.ReadBoolean
CustomLegend = b
' Series.CustomLegend:=b;
' read:=read+fs.read(b, sizeof( Boolean ));
DrawLine = MyStreamReader.ReadBoolean
' Series.DrawLine:=b;
' read:=read+fs.read(b, sizeof( Boolean ));
DrawPoints = MyStreamReader.ReadBoolean
'If DrawLine Then
' If Not DrawPoints Then
' NewSeries.ChartType = SeriesChartType.FastLine
' Else
' NewSeries.ChartType = SeriesChartType.Line
' End If
'End If
' Series.DrawPoints:=b;
' read:=read+fs.read(b, sizeof( Boolean ));
NewSeries.LinePen.Visible = DrawLine
NewSeries.Pointer.Visible = DrawPoints
b = MyStreamReader.ReadBoolean
' Series.FillPoints:=b;
' b:=loadGraphAppearance;
' loadGraphAppearance:=true;
' if not ReadString(@series.LegendName) then exit;
LegendText = ReadExtendedString(Left, Top, Bottom, Right, RTFString)
If CustomLegend Then
If NewSeries.Tag = Nothing Then NewSeries.Tag = ""
NewSeries.Title = LegendText
ii = RTFString.IndexOf("*10")
If ii > 0 Then
RTFString = RTFString.Replace("*10", "·10")
End If
If RTFString = "" Then
RTB.Clear()
RTB.Width = 1000
RTB.Text = LegendText
RTB.Invalidate()
RTFString = RTB.Rtf
End If
'MyFunctions.SetValueInTag(NewSeries.Tag, "Benutzerdefinierte Legende", "Oben", Top.ToString)
'MyFunctions.SetValueInTag(NewSeries.Tag, "Benutzerdefinierte Legende", "Links", Left.ToString)
'MyFunctions.SetValueInTag(NewSeries.Tag, "Benutzerdefinierte Legende", "Höhe", (Bottom - Top).ToString)
'MyFunctions.SetValueInTag(NewSeries.Tag, "Benutzerdefinierte Legende", "Breite", (Right - Left + 10).ToString)
'MyFunctions.SetValueInTag(NewSeries.Tag, "Benutzerdefinierte Legende", "Orientierung", "0")
MyFunctions.SetValueInTag(NewSeries.Tag, "Benutzerdefinierte Legende", "RTF", "ja")
MyFunctions.SetValueInTag(NewSeries.Tag, "Benutzerdefinierte Legende", "Alignment", "0")
MyFunctions.SetValueInTag(NewSeries.Tag, "Benutzerdefinierte Legende", "RTFText", RTFString + "<<Ende des RTF>>")
Graph.Legend.Font.Color = Color.Transparent
End If
' loadGraphAppearance:=b;
' read:=read+fs.read(ls, sizeof( TLegendStatus ));
bt = MyStreamReader.ReadByte
' Series.LegendStatus:=ls;
' read:=read+fs.read(cl, sizeof( TColor ));
ii = MyStreamReader.ReadInt32
TColor2RGB(ii, LineColorR, LineColorG, LineColorB)
NewSeries.Color = Color.FromArgb(255, LineColorR, LineColorG, LineColorB)
' Series.LineColor:=cl;
' read:=read+fs.read(ps, sizeof( TPenStyle ));
bt = MyStreamReader.ReadByte
' Series.LineStyle:=ps;
' read:=read+fs.read(ii, sizeof( integer ));
ii = MyStreamReader.ReadInt32
NewSeries.LinePen.Width = ii
' Series.LineWidth:=ii;
' read:=read+fs.read(cl, sizeof( TColor ));
ii = MyStreamReader.ReadInt32
TColor2RGB(ii, PointColorR, PointColorG, PointColorB)
NewSeries.LinePen.Color = Color.FromArgb(255, PointColorR, PointColorG, PointColorB)
' Series.PointColor:=cl;
' read:=read+fs.read(PointCount, SizeOf(integer));
PointCount = MyStreamReader.ReadInt32
' read:=read+fs.read(pts, sizeof( et_PointShape ));
PointShape = MyStreamReader.ReadByte
' Series.PointShape:=pts;
' read:=read+fs.read(w, sizeof( Word ));
ii = MyStreamReader.ReadInt16
NewSeries.Pointer.VertSize = ii
NewSeries.Pointer.HorizSize = ii
'If DrawPoints Then
'If Not DrawLine Then NewSeries. = SeriesChartType.Point
NewSeries.Pointer.Color = Color.FromArgb(255, PointColorR, PointColorG, PointColorB)
NewSeries.LinePen.Color = Color.FromArgb(255, PointColorR, PointColorG, PointColorB)
Select Case PointShape
Case 0
NewSeries.Pointer.Style = Styles.PointerStyles.Rectangle
Case 1
NewSeries.Pointer.Style = Styles.PointerStyles.Circle
Case 2
NewSeries.Pointer.Style = Styles.PointerStyles.Diamond
Case 3
NewSeries.Pointer.Style = Styles.PointerStyles.DiagCross
Case 4
NewSeries.Pointer.Style = Styles.PointerStyles.Cross
Case Else
NewSeries.Pointer.Style = Styles.PointerStyles.Rectangle
End Select
'Else
'NewSeries.MarkerStyle = MarkerStyle.None
'End If
' Series.PointSize:=w;
' Series.SeriesName:=readstring(false); ***************************************
s = ReadString()
s = MyFunctions.GetSeriesName(Graph, s)
If Not CustomLegend Then NewSeries.Title = s
MyFunctions.SetValueInTag(NewSeries.Tag, "Parameter", "ausSpektren3d", "ja")
MyFunctions.SetValueInTag(NewSeries.Tag, "Parameter", "Serienname", s)
MyFunctions.SetValueInTag(NewSeries.Tag, "Parameter", "MyFileIO-Version", Ver.ToString)
'NewSeries.Tag = "[Parameter]" + Chr(13) + "ausSpektren3d: ja" + Chr(13) + "Serienname: " + s
'NewSeries.Tag = NewSeries.Tag + Chr(13) + "MyFileIO-Version: " + Ver.ToString
'MyFunctions.SetSeriesName(Graph, NewSeries, s)
'Dim an As TextAnnotation = Graph.Annotations.FindByName(NewSeries.Name)
'MyFunctions.AddToSeriesAnnotation(Graph, NewSeries.Name, "Parameter", "aus(Spektren3d) : ja")
'********************************************************************************
' read:=read+fs.read(b, sizeof( Boolean ));
b = MyStreamReader.ReadBoolean
' Series.Sorted:=b;
' read:=read+fs.read(ii, sizeof( integer ));
ii = MyStreamReader.ReadInt32
If ii = 0 Then NewSeries.HorizAxis = HorizontalAxis.Bottom Else NewSeries.HorizAxis = HorizontalAxis.Top
' if ii = 0 then Series.WhichXAxis:=Graph.xAxis
' else Series.WhichXAxis:=Graph.xAxis_Second;
' read:=read+fs.read(ii, sizeof( integer ));
ii = MyStreamReader.ReadInt32
If ii = 0 Then NewSeries.VertAxis = VerticalAxis.Left Else NewSeries.VertAxis = VerticalAxis.Right
' if ii = 0 then Series.WhichYAxis:=Graph.yAxis
' else Series.WhichYAxis:=Graph.yAxis_Second;
' read:=read+fs.read(d, sizeof( double ));
d = MyStreamReader.ReadDouble
' Series.ZValue:=d;
' Series.SetPointNumber(PointCount);
Dim j As Integer
For j = 1 To PointCount
' for j:=1 to PointCount do begin
' read:=read+fs.read(x, SizeOf(double));
X = MyStreamReader.ReadDouble
' read:=read+fs.read(y, SizeOf(double));
Y = MyStreamReader.ReadDouble
' series.Add(x, y);
NewSeries.Add(X, Y)
Next
' If Version > 101 Then begin()
' read:=read+fs.read(b, sizeof( Boolean ));
' Series.SQRT_X:=b;
' read:=read+fs.read(b, sizeof( Boolean ));
' Series.Reciproke:=b;
' end;
If Ver > 101 Then
b = MyStreamReader.ReadBoolean
b = MyStreamReader.ReadBoolean
End If
' If Version > 105 Then begin()
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.ExSlit:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.EmmSlit:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.Wavelength:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.Filter:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.Speed:=readstring(false);
' end;
If Ver > 105 Then
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "ExSlit: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "EmSlit: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Wellenlänge: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Filter: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Geschwindigkeit: " + s
End If
' If Version > 108 Then begin()
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.method:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.date:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.response:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.expol:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.emmpol:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.filename:=readstring(false);
' end;
If Ver > 108 Then
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Methode: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Datum: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Response: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Exc-Polarisator: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Em-Polarisator: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Dateiname: " + s
End If
' If Version > 111 Then begin()
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.ScanStart:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.ScanEnd:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.Averaging:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.Averaging_TD:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.StepWidth:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.Spektrometer:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.ExperimentTime:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.Temperature:=readstring(false);
' end;
If Ver > 111 Then
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "ScanStart: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "ScanEnd: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Averaging: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Averaging_TD: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "StepWidth: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Spektrometer: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "ExperimentTime: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Temperatur: " + s
End If
' If Version > 113 Then begin()
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.TimePerFlash:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.Flashcount:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.DelayAfterFlash:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.SampleWindow:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.DelayIncrement:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.MaxDelay:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.FLLMode:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.ExcWavelength:=readstring(false);
' Graph.Series[OldSeriesCount+i].FluorescenceConditions.EmWavelength:=readstring(false);
' end;
If Ver > 113 Then
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "TimePerFlash: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Flashcount: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "DelayAfterFlash: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "SampleWindow: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "DelayIncrement: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "MaxDelay: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "FLLMode: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "ExcWavelength: " + s
s = ReadString()
NewSeries.Tag = NewSeries.Tag + Chr(13) + "EmWavelength: " + s
End If
' If Version > 112 Then begin()
' read:=read+fs.read(Graph.Series[OldSeriesCount+i].CIEProperties.HasCIEData, SizeOf(boolean));
' read:=read+fs.read(Graph.Series[OldSeriesCount+i].CIEProperties.L, SizeOf(double));
' read:=read+fs.read(Graph.Series[OldSeriesCount+i].CIEProperties.a, SizeOf(double));
' read:=read+fs.read(Graph.Series[OldSeriesCount+i].CIEProperties.b, SizeOf(double));
' read:=read+fs.read(Graph.Series[OldSeriesCount+i].CIEProperties.X, SizeOf(double));
' read:=read+fs.read(Graph.Series[OldSeriesCount+i].CIEProperties.Y, SizeOf(double));
' read:=read+fs.read(Graph.Series[OldSeriesCount+i].CIEProperties.Z, SizeOf(double));
' end;
If Ver > 112 Then
b = MyStreamReader.ReadBoolean
NewSeries.Tag = NewSeries.Tag + Chr(13) + "HasCIEData: " + s
b = MyStreamReader.ReadDouble
NewSeries.Tag = NewSeries.Tag + Chr(13) + "L: " + s
b = MyStreamReader.ReadDouble
NewSeries.Tag = NewSeries.Tag + Chr(13) + "a: " + s
b = MyStreamReader.ReadDouble
NewSeries.Tag = NewSeries.Tag + Chr(13) + "b: " + s
b = MyStreamReader.ReadDouble
NewSeries.Tag = NewSeries.Tag + Chr(13) + "X: " + s
b = MyStreamReader.ReadDouble
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Y: " + s
b = MyStreamReader.ReadDouble
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Z: " + s
End If
' If Version > 109 Then begin()
' read:=read+fs.read(d, sizeof( double ));
' TitrationData.StartVolume:=d;
' read:=read+fs.read(d, sizeof( double ));
' TitrationData.TotalVolume:=d;
' read:=read+fs.read(d, sizeof( double ));
' TitrationData.LastTitratorConc:=d;
' Graph.Series[OldSeriesCount+i].TitrationData:=TitrationData;
' read:=read+fs.Read(b, sizeof(b));
' Graph.Series[OldSeriesCount+i].PointsContainTitrationData:=b;
' if Graph.Series[OldSeriesCount+i].PointsContainTitrationData then begin
' SetLength(Graph.Series[OldSeriesCount+i].pointTitrationData, Graph.Series[OldSeriesCount+i].PointCount);
' for j:=1 to Graph.Series[OldSeriesCount+i].PointCount do begin
' read:=read+fs.read(TitrationData, SizeOf(TTitrationData));
' Graph.Series[OldSeriesCount+i].PointTitrationData[j-1]:=TitrationData;
' end;
' end;
' end;
If Ver > 109 Then
'Dim StartVolume As Double
'Dim TotalVolume As Double
'Dim LastTitratorConc As Double
d = MyStreamReader.ReadDouble
b = d <> 0
s1 = d.ToString
d = MyStreamReader.ReadDouble
s2 = d.ToString
d = MyStreamReader.ReadDouble
s3 = d.ToString
If b Then
NewSeries.Tag = NewSeries.Tag + Chr(13) + Chr(13) + Chr(13) + "[Titrationsdaten Serie]"
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Startvolumen: " + s1
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Gesamtvolumen: " + s2
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Letzte Titratorkonzentration: " + s3
End If
b = MyStreamReader.ReadBoolean
If b Then
NewSeries.Tag = NewSeries.Tag + Chr(13) + Chr(13) + Chr(13) + "[Punkt-Titrationsdaten]"
For j = 1 To PointCount
d = MyStreamReader.ReadDouble
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Startvolumen " + j.ToString + ": " + d.ToString
d = MyStreamReader.ReadDouble
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Gesamtvolumen " + j.ToString + ": " + d.ToString
d = MyStreamReader.ReadDouble
NewSeries.Tag = NewSeries.Tag + Chr(13) + "Letzte Titratorkonzentration " + j.ToString + ": " + d.ToString
Next
End If
End If
' If Version > 114 Then begin()
' read:=read+fs.read(ii, sizeof( integer ));
' for j:=0 to ii-1 do
' Graph.Series[OldSeriesCount+i].Protokoll.Add(readstring(false));
' end;
'end;
If Ver > 114 Then
ii = MyStreamReader.ReadInt32
For j = 1 To ii
s = ReadString()
MyFunctions.AddToSeriesTag(NewSeries, "Protokoll", s)
Next
End If
Try
If Not NewSeries.Pointer.Visible Then Steema.TeeChart.Styles.Series.ChangeType(NewSeries, GetType(Steema.TeeChart.Styles.FastLine))
Catch ex As Exception
If ex.Message = "test" Then MsgBox(ex.Message)
End Try
Next
' If Version > 110 Then begin()
' read:=read+fs.Read(i, sizeof(integer));
If Ver > 110 Then MyStreamReader.ReadInt32()
' result:=read=i;
' if not result then exit;
'end;
Return True
End Function