How to fix my "Type missmatch error".

Im new to Xojo , and I am trying to apply an algorithm that I used in Visual Basic for a basic temperature converter (Centigrade to Fahrenheit , Fahrenheit to Centigrade).

I entered some code ,which applies to the “Calculate” button I created, which when pressed will calculate/ convert the temperature. I have a feature in my algorithm in which there will be a ‘change mode’ feature which will reverse the calculations. But for now , could I have some clarification on to why a "Type missmatch error has appeared on code I have entered. Which is ;

[code] Dim isCentigrade As Boolean

isCentigrade = True

If isCentigrade = True Then

txtOutput.Text = Val(txtInput.Text * 9) /5 + 32

Else

txtOutput.Text = Val(txtInput.Text *5 ) / 9 - 32

End If[/code]

*Please note that , command words I use are those that apply to visual basic, and I am not sure if they are the same for Xojo , although I do understand they use similar languages.

txtoutput.text requires a string. Add Str to the mix.

txtOutput.Text = Str(Val(txtInput.Text * 9) /5 + 32)

You also need to adjust your parentheses.

txtOutput.Text = Str(Val(txtInput.Text) * 9 / 5 + 32)

Val applies only to txtInput.Text. Otherwise, you’re trying to multiply a string (txtInput.Text) by an integer (9) and then take the Val() of the result.