from Codemodule to Main

Lutz99999

New Member
Licensed User
Longtime User
Hello,

how can ich change the text from the code module to the Main.
Code in the Main

Sub Process_Globals
Dim txtFehlerspeicher As EditText
end sub

Sub Globals

end sub


in the CodeModule

Public Sub TextinsTextfeld(was As String)
If was.Length =0 Then
Main.txtFehlerspeicher.Text =""
Return
End If

Main.Fehlerspeicher.Text = CRLF & Main.txtFehlerspeicher.Text & was

End Sub

but it doesn't work...

please help

Greetings Lutz
 

klaus

Expert
Licensed User
Longtime User
You cannot declare activity objects in Process_Globals !
You cannot access activity objects directly from a code module !
You must declare the EditText in Globals.
And transfer the EditText view to the code module in the calling routine.
Main module:
B4X:
Sub Globals
    Dim txtFehlerspeicher As EditText
End Sub
.
.
.
Test.TextInsFeld(txtFehlerspeicher, "abc")
and in the code module Test:
B4X:
Public Sub TextInsFeld(edt As EditText, was As String)
    If was.Length =0 Then
        edt.Text =""
        Return
    End If

    edt.Text = CRLF & edt.Text & was
End Sub
Are you really want this : edt.Text = CRLF & edt.Text & was
and not this : edt.Text = edt.Text & CRLF & was

Best regards.
 
Upvote 0

Lutz99999

New Member
Licensed User
Longtime User
Thanks for the Answer.
In .net i can to and from Module jumping.
then i must take your method.


Thanks Lutz:sign0188:
 
Upvote 0
Top