Android Question [SOLVED]Strange thing in CallSub

Discussion in 'Android Questions' started by incendio, Sep 19, 2015.

  1. incendio

    incendio Well-Known Member Licensed User

    I was testing AutoTextSize Class, and tried to create my own EditText Class.

    Something strange with sub CallSub.

    Here are my code in main Activity
    Code:
    Sub Process_Globals
    End Sub

    Sub Globals
        
    Dim edt1 As CustomEdT
    End Sub

    Sub Activity_Create(FirstTime As Boolean)
        
    Activity.LoadLayout("1")
        edt1.Init(Me,
    "EnterPressed",0,2)
    End Sub

    Sub EnterPressed
        
    Msgbox("done","")
    End Sub
    and here are the snippet codes of my class
    Code:
    Public Sub Init(Target As Object,EventName As String,FldTyp As Byte,DecimalNo As Byte)
       mTarget  = Target
       mEventName = EventName
       FieldType  = FldTyp
       DecNo     = DecimalNo 
       FormatField
    End Sub

    Private Sub edt_EnterPressed
        
    If SubExists(mTarget,mEventName.Trim) Then
            
    CallSub(mTarget,mEventName.Trim)
        
    Else
            
    Msgbox("Sub Not exist","")
        
    End If
    End Sub
    Those snippet code raised a message box that says Sub Not Exist, but if code in sub EnterPressed change to this
    Code:
    Private Sub edt_EnterPressed
        
    If SubExists(mTarget,mEventName.Trim) Then
            
    CallSub(mTarget,"EnterPressed")
        
    Else
            
    Msgbox("Sub Not exist","")
        
    End If
    End Sub
    It return message box done, which is the correct one.
    I wonder what is wrong here, am i missing something?

    EDIT
    changes in class code seem solved the problem.
     

    Attached Files:

    Last edited: Sep 20, 2015
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice