Skip to main content
added 104 characters in body
Source Link
Dany
  • 13
  • 4

I have a form made it with a couple of text boxes, in which I input a number andfloating numbers and use this number to sum with other text box and put the result in a label.

I transfer thethen input inthe values of the text boxes to a variable (xbiz and xbder) and I sum plus "5it for example I get then this result : xbiz = 5.2"2 xbder = 2.3

My problem is when one of the text boxes is empty (in blank) the script give me an error of "ILLEGAL FLOAT VALUE!" I mean if I am not input a value in any od the two variables

How can solve this problem?

Here is my code:

#FORM
echo "FG 999999" >> $gui_in
echo "FONT cbr18" >> $gui_in
echo "BG 901010" >> $gui_in
echo "LABEL LOCATINES" >> $gui_in
echo "FG 101090" >> $gui_in
echo "FONT cbr18" >> $gui_in
echo "BG 708787" >> $gui_in

echo "TEXT xbiz X_BOT_IZQ" >> $gui_in
echo "TEXT xbder X_BOT_DER" >> $gui_in

#Calculation
set varx = `echo " 5.2$xbder + $xbiz" | bc -l`
set vary = `echo " 5.2 + $xbder" | bc -l`

#After calculate the values of the two variables (varxxbder and+ varyxbiz) I use the result in the following line:

COM display_layer,name=comp,display=yes,number=1
COM add_pad,attributes=no,**x=${varx},y=${varyvarx}**,symbol=${sizefido},polarity=positive,\
angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
 

I have a form made it with text boxes, in which I input a number and use this number to sum with other text box and put the result in a label.

I transfer the input in the text boxes to a variable (xbiz and xbder) and I sum plus "5.2"

My problem is when one of the text boxes is empty (in blank) the script give me an error of "ILLEGAL FLOAT VALUE!"

How can solve this problem?

Here is my code:

#FORM
echo "FG 999999" >> $gui_in
echo "FONT cbr18" >> $gui_in
echo "BG 901010" >> $gui_in
echo "LABEL LOCATINES" >> $gui_in
echo "FG 101090" >> $gui_in
echo "FONT cbr18" >> $gui_in
echo "BG 708787" >> $gui_in

echo "TEXT xbiz X_BOT_IZQ" >> $gui_in
echo "TEXT xbder X_BOT_DER" >> $gui_in

#Calculation
set varx = `echo " 5.2 + $xbiz" | bc -l`
set vary = `echo " 5.2 + $xbder" | bc -l`

#After calculate the values of the two variables (varx and vary) I use the result in the following line:

COM display_layer,name=comp,display=yes,number=1
COM add_pad,attributes=no,**x=${varx},y=${vary}**,symbol=${sizefido},polarity=positive,\
angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
 

I have a form made it with a couple of text boxes, in which I input floating numbers and use this number to sum with other text box and put the result in a label.

I then input the values of the text boxes to a variable (xbiz and xbder) and I sum it for example I get then this result : xbiz = 5.2 xbder = 2.3

My problem is when one of the text boxes is empty (in blank) the script give me an error of "ILLEGAL FLOAT VALUE!" I mean if I am not input a value in any od the two variables

How can solve this problem?

Here is my code:

#FORM
echo "FG 999999" >> $gui_in
echo "FONT cbr18" >> $gui_in
echo "BG 901010" >> $gui_in
echo "LABEL LOCATINES" >> $gui_in
echo "FG 101090" >> $gui_in
echo "FONT cbr18" >> $gui_in
echo "BG 708787" >> $gui_in

echo "TEXT xbiz X_BOT_IZQ" >> $gui_in
echo "TEXT xbder X_BOT_DER" >> $gui_in

#Calculation
set varx = `echo " $xbder + $xbiz" | bc -l`


#After calculate the values of the two variables (xbder + xbiz) I use the result in the following line:

COM display_layer,name=comp,display=yes,number=1
COM add_pad,attributes=no,**x=${varx},y=${varx}**,symbol=${sizefido},polarity=positive,\
angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
 
I realize that I need to sum 5.2 instead of 5 like I mentioned before
Source Link
Dany
  • 13
  • 4

I have a form made it with text boxes, in which I input a number and use this number to sum with other text box and put the result in a label.

I transfer the input in the text boxes to a variable (xbiz and xbder) and I sum plus "5""5.2"

My problem is when one of the text boxes is empty (in blank) the script give me an error of "ILLEGAL FLOAT VALUE!"

How can solve this problem?

Here is my code:

#FORM
echo "FG 999999" >> $gui_in
echo "FONT cbr18" >> $gui_in
echo "BG 901010" >> $gui_in
echo "LABEL LOCATINES" >> $gui_in
echo "FG 101090" >> $gui_in
echo "FONT cbr18" >> $gui_in
echo "BG 708787" >> $gui_in

echo "TEXT xbiz X_BOT_IZQ" >> $gui_in
echo "TEXT xbder X_BOT_DER" >> $gui_in

#Calculation
set varx = `echo " 5.2 + $xbiz" | bc -l`
set vary = `echo " 5.2 + $xbder" | bc -l`

#After calculate the values of the two variables (varx and vary) I use the result in the following line:

COM display_layer,name=comp,display=yes,number=1
COM add_pad,attributes=no,**x=${varx},y=${vary}**,symbol=${sizefido},polarity=positive,\
angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
 

I have a form made it with text boxes, in which I input a number and use this number to sum with other text box and put the result in a label.

I transfer the input in the text boxes to a variable (xbiz and xbder) and I sum plus "5"

My problem is when one of the text boxes is empty (in blank) the script give me an error of "ILLEGAL FLOAT VALUE!"

How can solve this problem?

Here is my code:

#FORM
echo "FG 999999" >> $gui_in
echo "FONT cbr18" >> $gui_in
echo "BG 901010" >> $gui_in
echo "LABEL LOCATINES" >> $gui_in
echo "FG 101090" >> $gui_in
echo "FONT cbr18" >> $gui_in
echo "BG 708787" >> $gui_in

echo "TEXT xbiz X_BOT_IZQ" >> $gui_in
echo "TEXT xbder X_BOT_DER" >> $gui_in

#Calculation
set varx = `echo " 5 + $xbiz" | bc -l`
set vary = `echo " 5 + $xbder" | bc -l`

#After calculate the values of the two variables (varx and vary) I use the result in the following line:

COM display_layer,name=comp,display=yes,number=1
COM add_pad,attributes=no,**x=${varx},y=${vary}**,symbol=${sizefido},polarity=positive,\
angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
 

I have a form made it with text boxes, in which I input a number and use this number to sum with other text box and put the result in a label.

I transfer the input in the text boxes to a variable (xbiz and xbder) and I sum plus "5.2"

My problem is when one of the text boxes is empty (in blank) the script give me an error of "ILLEGAL FLOAT VALUE!"

How can solve this problem?

Here is my code:

#FORM
echo "FG 999999" >> $gui_in
echo "FONT cbr18" >> $gui_in
echo "BG 901010" >> $gui_in
echo "LABEL LOCATINES" >> $gui_in
echo "FG 101090" >> $gui_in
echo "FONT cbr18" >> $gui_in
echo "BG 708787" >> $gui_in

echo "TEXT xbiz X_BOT_IZQ" >> $gui_in
echo "TEXT xbder X_BOT_DER" >> $gui_in

#Calculation
set varx = `echo " 5.2 + $xbiz" | bc -l`
set vary = `echo " 5.2 + $xbder" | bc -l`

#After calculate the values of the two variables (varx and vary) I use the result in the following line:

COM display_layer,name=comp,display=yes,number=1
COM add_pad,attributes=no,**x=${varx},y=${vary}**,symbol=${sizefido},polarity=positive,\
angle=0,mirror=no,nx=1,ny=1,dx=0,dy=0,xscale=1,yscale=1
 

ILLEGAL FLOAT VALUE "ERROR" C Illegal float value "error" c-SHELLshell

deleted 30 characters in body
Source Link
Anthon
  • 81.4k
  • 42
  • 174
  • 228
Loading
edited tags
Link
glenn jackman
  • 88.5k
  • 16
  • 124
  • 179
Loading
Source Link
Dany
  • 13
  • 4
Loading