I’ve just recently installed Clarion 10 and am in the process of converting my Clarion 5.5 applications to Clarion 10. A very frustrating procedure. I have the following snippet of code that works correctly the first time it is executed but does not work the next time the window is opened. The code is as follows:
FillQueue ROUTINE
FREE(List3)
Set(NewExtents)
LOOP
NEXT(NewExtents)
IF ERRORCODE() THEN BREAK.
Q3:Extent = NW1:Extent
IF LEN(CLIP(Q3:Extent)) > 0
ADD(List3,+Q3:Extent)
END
END
As you can see, it’s pretty straight forward and worked fine in Clarion 5.5. However in Clarion 10, the first time it reads the NewExtents file and fills the queue correctly. But the next time the window is opened, it reads a totally different file. I’ve stopped the app with the debugger and the filename is correct but the data read is from another file used by the window. I also get no errors like Invalid Record Declaration.
This has me really baffled. Does anyone have any insight into what might be causing this?
Thanks for your reply but your change made no difference. Like I said in my post, I’ve stopped the app with the debugger and I see different values being read on the Next statement and they are coming from the Partnums file. The first time I see the following:
The next and subsequent times I see:
which are the same values as the following:
Sounds like a bug in clarion to me. Should be reported.
Many years ago in C6 I had a problem where the driver would very occasionally use the wrong driver string for ODBC tables and pick the wrong DB.
That should be working. But the spec for the files and controls would help us.
If all else fails, I would delete the drop list and the queue, and instead place a template control called “File loaded drop box” (in the window designer screen). It should handle the queue and file automatically.
Thanks for all the replies but I think this has something to do with threading. I’m upgrading from Clarion 5.5 where threads were handled completely different. All the files are threaded but many static variables in the Global Data area are not. I don’t see how they would manifest themselves in this way but other issues I was having were cleared up when I did things within the current thread opposed to doing it from Thread #1. I haven’t reworked this screen but will let you know what happens when I do.
I know this is an old thread, but want for completeness just add what I think.
Consider that the file NewExtents is closed the second time you going into it.
Your code structure only traps an error after the next which breaks out on any error. So it it might just be that the file is not open. You might have badly nested open and close statements can also be from previous calling procedures.