Hi everyone,
I am not sure if this should work in Clarion or if there are any restrictions:
I want to display a queue within a LIST in my window. The queue is defined in a small class that is really simple constructed (create an instance of the queue, fill it with some entries).
But already the open(win) command crashes with „Internal error 01: WSLDIAL“.
I guess there is problem with the instance/scope of the queue definition. But I have no idea what to change - maybe somebody sees immediately what’s wrong. Thanks you for time & support!
PROGRAM
MAP
END
CrashQueueType queue,type
cDummy STRING(10)
end
MyQueueClass CLASS,TYPE
CrashQueue &CrashQueueType
Init PROCEDURE
Kill PROCEDURE
END
oMyQueue MyQueueClass
wWin WINDOW('Test'),AT(,,253,188),CENTER,GRAY,SYSTEM
LIST,AT(2,2,244,103),USE(?ListKessel),HVSCROLL,FROM(oMyQueue.CrashQueue), |
FORMAT('39L(2)~Dummy~@S10@')
BUTTON('Cancel'),AT(2,108,59,20),USE(?Cancel)
END
CODE
oMyQueue.Init
OPEN(wWin) ! -> crash
ACCEPT
END
oMyQueue.Kill
!----------------------------------------------------
MyQueueClass.Init PROCEDURE
CODE
self.CrashQueue &= NEW CrashQueueType
self.CrashQueue.cDummy = 'First'
add(self.CrashQueue)
self.CrashQueue.cDummy = 'Second'
add(self.CrashQueue)
return
MyQueueClass.Kill PROCEDURE
CODE
free(self.CrashQueue)
dispose(self.CrashQueue)
return
Thanks brahn,
I checked the prog again and the USE variable seems to be ok.
But the hint is quite good - I think the crash has to do with the link between the LIST and the queue of the class.
Is it so unusual to use a queue - that belongs to an instance of a class - in a normal LIST/Windows?
Perhaps the compiler does something to the window structure and in your original, at compile time, the variable you have assigned to the FROM is a reference which makes the runtime throw a wobbly. Not too sure, the WSLDIAL stuff is kind of magical
Sorry I’m late to this thread.
But another fix for this problem is to change the .INIT to a .CONSTRUCT
that winds up NEW’ing the Queue earlier, which is enough to solve the problem
(Tested with C10.0.12799)
I know, it seems like as long as you instantiate the queue before the open window that will be soon enough.
Well, apparently not.
FWIW, I have many LIST,USE(SomeClass.Q) in production