With some hunting and cutting the code down to pieces I was able to create this example. The code and port name work fine if I give the name directly to CreateRexxPort(), but if I try to make some conversion from lower case name to upper case, then it starts to act up. Funnily if UpperStr() doesn't need to change anything, issue doesn't seem to happen and everything works as it should be.
And this issue becomes visible only after some other action... the port name seems to be fine at first (the first p_port() check in this example), but then something triggers it (found it with ReadBytes() in my case).
Haven't tried this on other systems than MorphOS yet...
Code: Select all
; This doesn't work:
Const #APPNAME = "test"
; This works always:
;Const #APPNAME = "TEST"
Function p_port()
DebugPrint("Port check (" .. GetTime(True) .. "):", RunRexxScript("RETURN SHOW('P','TEST')", True))
EndFunction
CreateRexxPort(UpperStr(#APPNAME)) ; UpperStr causes problem here?
Local f=OpenFile(Nil,"System:Applications/OWB/OWB")
p_port() ; port name seems to be fine at this point still
Local data=ReadBytes(f,409600)
p_port() ; port name gets messed up after the previous line!
WaitLeftMouse()