Hi… I am new to Xojo. I am learning the basics using the tutorials.
I was trying to create a function. i need to call the function from UI
i am getting the error saying “expected double, but got string.”

The following is the code in method.
Dim theArea As Double
theArea = length *length
Return theArea

Text and numbers are something different to a computer, they are different data types even if to us they look identical. To distinguish them quotes are placed around text.

Mathematical operations are also different for text and for numbers.

For example If you add up text like “Markus” + " is " + “weird” then you end up with “Markus is weird”

And if you add up text like “5” + “8” + “2” then you end up with “582”

If however you add up numbers like 5 + 8 + 2 then you end up with 15

When you enter TEXT in a TEXTfield and you want to do maths on this input, then you have to convert the text to its numerical equivalent - thats what the VALUE function Val does.