Home > Back-end >  BCB run times wrong 'is not a valid float point value
BCB run times wrong 'is not a valid float point value

Time:09-15

BCB procedures grammar is no problem, but when loaded with some paper work, will quote 'is not a valid float point value

Point to the code is as follows:
If (slNC - & gt; Strings [I] AnsiPos (" X ") & gt; 0) dx2=slNCV - & gt; Values [r]. "X" ToDouble ();

If (slNC - & gt; Strings [I] AnsiPos (" Y ") & gt; 0) dy2=slNCV - & gt; Values [r]. "Y" ToDouble ();
If (slNC - & gt; Strings [I] AnsiPos (" I ") & gt; 0) di=slNCV - & gt; Values [r]. "I" ToDouble ();
If (slNC - & gt; Strings [I] AnsiPos (" J ") & gt; DJ=0) slNCV - & gt; Values [r]. "J" ToDouble ();

CodePudding user response:

What is sINCV object, how to define?

CodePudding user response:

reference 1st floor ooolinux response:
sINCV what object, how to define?


Gnome male - ", a great god we have "met"
SlNC - & gt; LoadFromFile (strNCFileNamePath);

SlNCV - & gt; DelimitedText=slNC - & gt; Strings [I];

CodePudding user response:

refer to the second floor LR_LULU response:
Quote: refer to 1st floor ooolinux response:
sINCV what object, how to define?


Gnome male - ", a great god we have "met"
SlNC - & gt; LoadFromFile (strNCFileNamePath);

SlNCV - & gt; DelimitedText=slNC - & gt; Strings [I];

Don't know what's your slNCV?

CodePudding user response:

reference ooolinux reply: 3/f
Quote: refer to the second floor LR_LULU response:
Quote: refer to 1st floor ooolinux response:
sINCV what object, how to define?


Gnome male - ", a great god we have "met"
SlNC - & gt; LoadFromFile (strNCFileNamePath);

SlNCV - & gt; DelimitedText=slNC - & gt; Strings [I];

Don't know what's your slNCV?


SlNCV put inside a file information from similar to the following paragraphs:

N29 G0 X=149.293 Y=153.293
N30 MSG (" LASERCUT NO. 3 ")
N31 TC_LASER_ON (0, "", 0, 0)
N32 by mechanical blending G1 X=Y=0.943-2.667
N33 G2 X=0.943 Y=1.333 I=0.943 J=0.333
N34 G1 X=49.7 Y=0
N35 G2 X=0.2 0.2 I=0, Y=J=0.2
N36 G1 X=0, Y=99.4
N37 G2 X=Y=0.2 I=0.2 0.2 J=0
N38 G1 X=99.4 Y=0
N39 G2 X=Y=0.2 0.2 I=0 J=0.2
N40 G1 X=0, Y=99.4
N41 G2 X=0.2 Y=0.2 I=0.2 J=0
N42 G1 X=49.7 Y=0
N43 G1 X=0.707 Y=0.707
N44 TC_LASER_OFF (1)

(dx2, dy2, di, DJ is of type double)

CodePudding user response:

Such, should be TStringList, TStringStream slNCV - & gt; Values [r]. "I" ToDouble (); If slNCV - & gt; Values (" I ") the string cannot be converted into floating point Numbers, like "a.x yz", will appear the exception, so you want to ensure that the data in the file is effective, or read in exception handling:
Try {the if (slNC - & gt; Strings [I] AnsiPos (" J ") & gt; DJ=0) slNCV - & gt; Values [r]. "J" ToDouble (); }
The catch (... ) {DJ=0; }

CodePudding user response:

LR_LULU
reference 4 floor response:
Quote: refer to the third floor ooolinux response:
Quote: refer to the second floor LR_LULU response:
Quote: refer to 1st floor ooolinux response:
sINCV what object, how to define?


Gnome male - ", a great god we have "met"
SlNC - & gt; LoadFromFile (strNCFileNamePath);

SlNCV - & gt; DelimitedText=slNC - & gt; Strings [I];

Don't know what's your slNCV?


SlNCV put inside a file information from similar to the following paragraphs:

N29 G0 X=149.293 Y=153.293
N30 MSG (" LASERCUT NO. 3 ")
N31 TC_LASER_ON (0, "", 0, 0)
N32 by mechanical blending G1 X=Y=0.943-2.667
N33 G2 X=0.943 Y=1.333 I=0.943 J=0.333
N34 G1 X=49.7 Y=0
N35 G2 X=0.2 0.2 I=0, Y=J=0.2
N36 G1 X=0, Y=99.4
N37 G2 X=Y=0.2 I=0.2 0.2 J=0
N38 G1 X=99.4 Y=0
N39 G2 X=Y=0.2 0.2 I=0 J=0.2
N40 G1 X=0, Y=99.4
N41 G2 X=0.2 Y=0.2 I=0.2 J=0
N42 G1 X=49.7 Y=0
N43 G1 X=0.707 Y=0.707
N44 TC_LASER_OFF (1)

(dx2, dy2, di, DJ is of type double)

The file you want to parse, not your code so simple,

CodePudding user response:

Have TStringList code can become simple, such segmentation to extract each line of each item in the convenient indeed, for some properties like Values I didn't forget how to use a temporary didn't understand your code, but some item is not in conformity with the Name=Value structure and then use Values (" X ") will encounter an exception this item cause I'm not sure, need to look at TStringList Help or relevant source code to determine, on the other hand, if a line contains "X", for "X=" will be better? Also, each line can use a temporary string speed will be hurry up,

CodePudding user response:

An error in the if (slNC - & gt; Strings [I] AnsiPos (" X ") & gt; 0) dx2=slNCV - & gt; Values [r]. "X" ToDouble (); This kind of statement which line, is the first line is the writing has a problem, if the other line, may be a data format of data file is not in conformity with the agreed
In addition, track your first line: dx2=slNCV - & gt; Values (" X ") and see what the string

CodePudding user response:

C code:
The FILE * f;
Double dx2, dy2, di, DJ;
Char buf [1024], [128] s.

If ((f=fopen (" test. TXT ", "r")))
For (; Dx2=dy2=di==0 DJ, fgets (buf, 1024, f),! The feof (f))
{
Sscanf (buf, X="% s % s % lf Y=% lf I=% lf J=% lf", s, s, & amp; Dx2, & amp; Dy2, & amp; Di, & amp; DJ);
//printf (" I==% f y=x % f % f j=% f \ n ", dx2, dy2, di, DJ);
}
The fclose (f);
  • Related