Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
K

kelvinic

@kelvinic
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Reading text file problem with casting to double
    K kelvinic

    y = Convert.ToDouble(lstChars.ToString()); gives the following error: Input string was not in a correct format. what can I do about this? Thanks for your reply.

    Algorithms help

  • Reading text file problem with casting to double
    K kelvinic

    I've trying to read a .txt files in order to plot the data on a ZedGraph. The problem is I cannot convert the data to double. The compiler gives bunch of errors(Error 1 Cannot convert type 'string' to 'double'). The following is a piece of code that i'm having trouble with. private void BRead(GraphPane myPane) { FileStream fleReader = new FileStream("kel.txt", FileMode.Open, FileAccess.Read); StreamReader stmReader = new StreamReader(fleReader); StringBuilder lstChars = new StringBuilder(); double x = 0, y; int iChar = stmReader.Read(); lstChars.Append((char)iChar); // double[] yx = new double[lstChars.Length]; PointPairList list = new PointPairList(); while (iChar > -1) { x = x + (double)0.0002; iChar = stmReader.Read(); lstChars.Append((char)iChar); y = (double)(lstChars.ToString()); //error list.Add(x, y); } this.textBox1.Text = lstChars.ToString(); stmReader.Close(); CurveItem myCurve = myPane.AddCurve("My Curve",list, Color.Red, SymbolType.Diamond); } can anyone help me please!!

    Algorithms help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups