Page 1 of 1

Type mismatch: wanted Float, got string instead Help

Posted: Sunday 3rd January 2021 3:38pm
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?

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

Posted: Sunday 3rd January 2021 3:56pm
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

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

Posted: Sunday 3rd January 2021 8:03pm
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.