Strange Error In Clarion 10

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,
Marie

Do you use NewExtents buffer for some manual queries elsewhere? Something like this:

NewExtents{prop:sql} = ‘select columnA, columnB… from tableC’

You will not see the Invalid Record Declaration error if those column’s data type match with first associated columns of tableC.

There’s other stuff going on that you haven’t told us about.

The only change I would make to your code is…

Your code isn’t reading the wrong file.

1 Like

Thanks for your reply but I’m not do anything like that.

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:
image
The next and subsequent times I see:
image
which are the same values as the following:
image

What is file driver used?
Any chance that you are changing file name variable somewhere in code

Leonid Chudakov

It is a FoxPro file. When I was debugging, I checked the filename variable and it was the correct file.
Marie

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.

Is List3 a global queue, or local queue?

It is a local queue.

I think I’d delete List3 and the dropdown listbox and recreate both.
It’s possible some FEQs are scrambled in some way.

Graham

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.

Please try to put CLEAR(NW1:Record) before Set(NewExtents).

Also try to use key on SET command like SET(NW1:Pk_NewExtents,NW1:Pk_NewExtents)

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.

Just a thought :slight_smile: