Code: Alles auswählen
Procedure SendString(ConID.l, text.s, typus.l)
Protected tempTypus.s = Str(typus)
If Len(tempTypus) < 2
tempTypus = "0" + tempTypus
EndIf
If ConID
Protected Outtext.s = ""
Outtext = "<" + ">" + tempTypus + text + "<\>"
Protected laenge.l = Len(Outtext)
Protected *buffer = AllocateMemory(laenge)
PokeS(*buffer, Outtext, Len(Outtext))
SendNetworkData(ConID, *buffer, MemorySize(*buffer))
FreeMemory(*buffer)
Debug "Send: " + Outtext
EndIf
EndProcedure
Allerdings tritt ab und an ein IMA in dieser Zeile auf
Code: Alles auswählen
Protected *buffer = AllocateMemory(laenge)
Bespiel: SendString(ServerID, "2;4;3;0;|", 13)
ergibt manchmal einen Fehler