# math problem

## Recommended Posts

ok, i have this code.

```#include <GUIConstants.au3>
#include <Math.au3>

\$Form1 = GUICreate("Form1", 625, 445, 193, 125)
\$Button1 = GUICtrlCreateButton("Button1", 24, 24, 137, 65, 0)
\$x1 = GUICtrlCreateInput("x1", 264, 40, 57, 21)
\$y1 = GUICtrlCreateInput("y1", 344, 40, 49, 21)
\$x2 = GUICtrlCreateInput("x2", 456, 40, 49, 21)
\$y2 = GUICtrlCreateInput("y2", 528, 40, 49, 21)
\$Label1 = GUICtrlCreateLabel(",", 328, 48, 12, 17)
\$Label2 = GUICtrlCreateLabel(",", 512, 48, 12, 25)
GUISetState(@SW_SHOW)
\$Label6 = GUICtrlCreateLabel("Label5", 168, 333, 276, 25)
;finalform
\$Label3 = GUICtrlCreateLabel("Label3", 168, 288, 276, 25)
\$Label4 = GUICtrlCreateLabel("Label4", 168, 310, 276, 25)
\$Label5 = GUICtrlCreateLabel("Label5", 168, 333, 276, 25)

#EndRegion ### END Koda GUI section ###
\$i = 100
Do
\$msg = GUIGetMsg()

if \$Msg = \$Button1 then  \$yy = ((\$y2v) - (\$y1v))
if \$Msg = \$Button1 then  \$xx = ((\$x2v) - (\$x1v))

if \$Msg = \$Button1 then  \$a = ((\$yy) / (\$xx))

if \$Msg = \$Button1 then MsgBox(4096, "A=", \$a)

if \$Msg = \$Button1 then  GUICtrlSetData(\$label3,"a=" & \$a)
if \$Msg = \$Button1 then  \$b = \$y1v-(\$a*\$x1v)
if \$Msg = \$Button1 then  GUICtrlSetData(\$label4,"b=" & \$b)

;formel
if \$Msg = \$Button1 then  GUICtrlSetData(\$label5, "ponies=" & \$a & "huggies+" \$b )

until \$msg = \$GUI_EVENT_CLOSE```

but!

error happens " GUICtrlSetData(\$label5, "ponies=" & \$a & "huggies+" \$b ) "

i want the final output to be

ponies=45huggies+50

given that \$a is 45 and \$b is 50

i dont get that autoit cant handle my ponies . (the text)

anyone can put the text in there and just give the final output as i want it?

##### Share on other sites

You forgot an & on that line between "huggies+" and \$b

Correct line:

`if \$Msg = \$Button1 then  GUICtrlSetData(\$label5, "ponies=" & \$a & "huggies+" & \$b )`

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

##### Share on other sites

You forgot an & on that line between "huggies+" and \$b

Correct line:

`if \$Msg = \$Button1 then  GUICtrlSetData(\$label5, "ponies=" & \$a & "huggies+" & \$b )`
aaaah, you win

thanks

what confused me was that the autoit error was at "ponies="

right under the first "

i tought i was using """ wrong

## Create an account

Register a new account

×

• Wiki

• Back

• Git