Load a B4xTable from a text file whose lines have the following format, separated by commas
Example of a file line:
0.204.5.2, FEDERAL 204 Ruger NOSLER Ballistic Tip, 32.2,0.206,1228,1143,1063,987,916,847,782, -3.8,0.3,2.5,2.5,0, -5.4, -14.3,1563,1355,1172,1010, 870,744,634,0.11,10014
partial code:
Main.DirCartuchos = File.DirRootExternal & "/ DeCazaGPS / Balistica"
Main.FicheroCartuchos="Cartuchos1.txt"
Dim data As List = su.LoadCSV2 (Main.DirCartuchos, Main.FicheroCartuchos, ",", headers)
Up to here everything is correct and working.
If I add to the file "cartuchos1.txt" a line from the program with:
Dim tw As TextWriter
tw.Initialize( File.OpenOutput(Main.DirCartuchos,Main.FicheroCartuchos,True))
tw.Write (EdtCalPul.text)
tw.Write (",")
tw.Write (EdtCalibreMM.text)
tw.Write (",")
tw.Write (EdtDeno.Text)
tw.Write (",")
tw.Write (NumberFormat (EdtGrains.Text, 1.0))
tw.Write (",")
tw.Write (NumberFormat (EdtGramos.Text, 1,1))
tw.Write (",")
tw.Write (EdtCB.Text)
tw.Write (",")
tw.Write (NumberFormat (EdtV0.Text, 1.0))
tw.Write (",")
tw.Write (NumberFormat (EdtV50.Text, 1.0))
tw.Write (",")
tw.Write (NumberFormat (EdtV100.Text, 1.0))
tw.Write (",")
tw.Write (NumberFormat (EdtV150.Text, 1.0))
tw.Write (",")
tw.Write (NumberFormat (EdtV200.Text, 1.0))
tw.Write (",")
tw.Write (NumberFormat (EdtV250.Text, 1.0))
tw.Write (",")
tw.Write (NumberFormat (EdtV300.Text, 1.0))
tw.Write (",")
tw.Write (EdtElev0.Text)
tw.Write (",")
tw.Write (EdtElev50.Text)
tw.Write (",")
tw.Write (EdtElev100.Text)
tw.Write (",")
tw.Write (EdtElev150.Text)
tw.Write (",")
tw.Write (EdtElev200.Text)
tw.Write (",")
tw.Write (EdtElev250.Text)
tw.Write (",")
tw.Write (EdtElev300.Text)
tw.Write (",")
tw.Write (Round (0.5 * EdtGramos.Text * EdtV0.Text * EdtV0.Text * 0.001))
tw.Write (",")
tw.Write (Round (0.5 * EdtGramos.Text * EdtV50.Text * EdtV50.Text * 0.001))
tw.Write (",")
tw.Write (Round (0.5 * EdtGramos.Text * EdtV100.Text * EdtV100.Text * 0.001))
tw.Write (",")
tw.Write (Round (0.5 * EdtGramos.Text * EdtV150.Text * EdtV150.Text * 0.001))
tw.Write (",")
tw.Write (Round (0.5 * EdtGramos.Text * EdtV200.Text * EdtV200.Text * 0.001))
tw.Write (",")
tw.Write (Round (0.5 * EdtGramos.Text * EdtV250.Text * EdtV250.Text * 0.001))
tw.Write (",")
tw.Write (Round (0.5 * EdtGramos.Text * EdtV300.Text * EdtV300.Text * 0.001))
tw.Write (",")
tw.Write ("0.5")
tw.Write (",")
tw.Write (EditText1.Text)
tw.Close
this is the line recorded in the txt file
0.51,13,SAKO 500 Jeffery TWINHEAD II,535,34,0.285,710,663,616,573,530,492,454,-4.5,2.8,4.0,0.0,-12.5,-33.0,-64.7,8570,7473,6451,5582,4775,4115,3504,0.5,11919
When I come back to:
Dim data As List = su.LoadCSV2 (Main.DirCarts, Main.FileCards, ",", headers)
I miss the following error:
java.lang.StringIndexOutOfBoundsException: length = 304602; regionStart = 304596; regionLength = -304597
Could you help me solve it?
Greetings.
Example of a file line:
0.204.5.2, FEDERAL 204 Ruger NOSLER Ballistic Tip, 32.2,0.206,1228,1143,1063,987,916,847,782, -3.8,0.3,2.5,2.5,0, -5.4, -14.3,1563,1355,1172,1010, 870,744,634,0.11,10014
partial code:
Main.DirCartuchos = File.DirRootExternal & "/ DeCazaGPS / Balistica"
Main.FicheroCartuchos="Cartuchos1.txt"
Dim data As List = su.LoadCSV2 (Main.DirCartuchos, Main.FicheroCartuchos, ",", headers)
Up to here everything is correct and working.
If I add to the file "cartuchos1.txt" a line from the program with:
Dim tw As TextWriter
tw.Initialize( File.OpenOutput(Main.DirCartuchos,Main.FicheroCartuchos,True))
tw.Write (EdtCalPul.text)
tw.Write (",")
tw.Write (EdtCalibreMM.text)
tw.Write (",")
tw.Write (EdtDeno.Text)
tw.Write (",")
tw.Write (NumberFormat (EdtGrains.Text, 1.0))
tw.Write (",")
tw.Write (NumberFormat (EdtGramos.Text, 1,1))
tw.Write (",")
tw.Write (EdtCB.Text)
tw.Write (",")
tw.Write (NumberFormat (EdtV0.Text, 1.0))
tw.Write (",")
tw.Write (NumberFormat (EdtV50.Text, 1.0))
tw.Write (",")
tw.Write (NumberFormat (EdtV100.Text, 1.0))
tw.Write (",")
tw.Write (NumberFormat (EdtV150.Text, 1.0))
tw.Write (",")
tw.Write (NumberFormat (EdtV200.Text, 1.0))
tw.Write (",")
tw.Write (NumberFormat (EdtV250.Text, 1.0))
tw.Write (",")
tw.Write (NumberFormat (EdtV300.Text, 1.0))
tw.Write (",")
tw.Write (EdtElev0.Text)
tw.Write (",")
tw.Write (EdtElev50.Text)
tw.Write (",")
tw.Write (EdtElev100.Text)
tw.Write (",")
tw.Write (EdtElev150.Text)
tw.Write (",")
tw.Write (EdtElev200.Text)
tw.Write (",")
tw.Write (EdtElev250.Text)
tw.Write (",")
tw.Write (EdtElev300.Text)
tw.Write (",")
tw.Write (Round (0.5 * EdtGramos.Text * EdtV0.Text * EdtV0.Text * 0.001))
tw.Write (",")
tw.Write (Round (0.5 * EdtGramos.Text * EdtV50.Text * EdtV50.Text * 0.001))
tw.Write (",")
tw.Write (Round (0.5 * EdtGramos.Text * EdtV100.Text * EdtV100.Text * 0.001))
tw.Write (",")
tw.Write (Round (0.5 * EdtGramos.Text * EdtV150.Text * EdtV150.Text * 0.001))
tw.Write (",")
tw.Write (Round (0.5 * EdtGramos.Text * EdtV200.Text * EdtV200.Text * 0.001))
tw.Write (",")
tw.Write (Round (0.5 * EdtGramos.Text * EdtV250.Text * EdtV250.Text * 0.001))
tw.Write (",")
tw.Write (Round (0.5 * EdtGramos.Text * EdtV300.Text * EdtV300.Text * 0.001))
tw.Write (",")
tw.Write ("0.5")
tw.Write (",")
tw.Write (EditText1.Text)
tw.Close
this is the line recorded in the txt file
0.51,13,SAKO 500 Jeffery TWINHEAD II,535,34,0.285,710,663,616,573,530,492,454,-4.5,2.8,4.0,0.0,-12.5,-33.0,-64.7,8570,7473,6451,5582,4775,4115,3504,0.5,11919
When I come back to:
Dim data As List = su.LoadCSV2 (Main.DirCarts, Main.FileCards, ",", headers)
I miss the following error:
java.lang.StringIndexOutOfBoundsException: length = 304602; regionStart = 304596; regionLength = -304597
Could you help me solve it?
Greetings.