Combobox Mac <> Windows?

I have a business app where I use a Combobox for setting the form of address like in letters. For easy access to frequently used forms, the Change event goes like this:

Sub Change() Handles Change dim mytext as text = me.text.ToText if mytext = kSGDH or mytext = kSGAnrede or mytext = kliebeFormell or mytext = kliebePersönlich then dim anrede as text = AnredeBox.text.ToText dim Vorname as text = VornameField.text.ToText dim nachname as text = NachnameField.text.ToText me.text = MakeBriefAnrede(anrede, Vorname, Nachname, mytext) end if End Sub

And the MakeBriefAnrede method is

Private Function MakeBriefAnrede(anrede as text, Vorname as text, Nachname as Text, Formel as text) as text dim extender as text = if (anrede = kHerr, "r", "") dim brief as text select case Formel case kSGDH brief = kSGDH case kSGAnrede brief = "Sehr geehrte"+extender+kspace+anrede+kspace+nachname case kliebeFormell brief = "Liebe"+extender+kspace+anrede+kspace+nachname case kliebePersönlich brief = "Liebe"+extender+kspace+vorname end select return brief End Function

This works perfectly with macOS, but under Windows (where the return parameter brief is correct), the ComboBox.text is empty afterwards.
Any idea why?

[/quote][quote=319661:@Ulrich Bogun]I
Any idea why?[/quote]

An encoding issue I would say. Got something similar experienced when dealing with the type .

Thanks, Alfred. Doesn’t seem so: I changed the method to return a string, but still the same: Empty ComboBox, although the string is received.

you changed also the args of that function?

You mean that could be the reason, although the method works? Sounds weird, but I’ll give it a try.

EDIT: Nope. Everything String now, including the constants. Still empty.

Got it! I had to decouple setting the text from the Change event.
Now there is a SetAnredeText method which takes an auto that is being called by a

Xojo.Core.Timer.Calllater 0, addressof SetAnredeText, MakeBriefAnrede(anrede, Vorname, Nachname, mytext)

and that does the trick. D’oh!

P.S.: And it works with Text, too!
Thanks for your help, Alfred! Good to talk things over, that clears the mind for different solutions.