Type mismatch: wanted Float, got string instead Help

Post your Gambas programming questions here.
Post Reply
AndyGable
Posts: 359
Joined: Wednesday 2nd December 2020 12:11am
Location: Northampton, England
Contact:

Type mismatch: wanted Float, got string instead Help

Post by AndyGable »

Hi all you experts,

I need some help (i think I may have done something wrong here)

I have the following sub Function

Code: Select all

Private Sub DisplayText(TextToShow As String)
  
  Select Case Global.TextBoxNumber
      Case 1 ' User ID Number
          If TextToShow <> "" Then
              labUserID.Caption += TextToShow
          Else
              Me.labUserID.Caption += TextToShow
          End If
        
        Case 2 ' User Password
          If TextToShow <> "" Then
              Global.UserPassword += TextToShow
              labPassword.Caption += TextToShow
          Else
              Global.UserPassword = Null
              Me.labPassword.Caption += TextToShow
          End If
  End Select
End
but when I call it from my frm I get the following error message Type mismatch: wanted Float, got string instead in FrmSignOn:81

What am i doing wrong here?
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: Type mismatch: wanted Float, got string instead Help

Post by stevedee »

AndyGable wrote: Sunday 3rd January 2021 3:38pm

I have the following sub Function

Code: Select all

              labUserID.Caption += TextToShow
...What am i doing wrong here?
You are still wearing your VB head. In Gambas your should use:-
              labUserID.Caption &= TextToShow
AndyGable
Posts: 359
Joined: Wednesday 2nd December 2020 12:11am
Location: Northampton, England
Contact:

Re: Type mismatch: wanted Float, got string instead Help

Post by AndyGable »

stevedee wrote: Sunday 3rd January 2021 3:56pm
AndyGable wrote: Sunday 3rd January 2021 3:38pm

I have the following sub Function

Code: Select all

              labUserID.Caption += TextToShow
...What am i doing wrong here?
You are still wearing your VB head. In Gambas your should use:-
              labUserID.Caption &= TextToShow
Stevedee,

Thank-you for pointing that out to me I would not have figured that out on my own.
Post Reply