Queue of Queues problem. 
Author Message
 Queue of Queues problem.

Hi all,

Havin a bit of trouble with a calender function I'm working on.  The
design calls for a queue of queues which seems to work accept when I
return from the procedure. Here's the setup:

aDayQueueType       QUEUE,type
field1                long
field2                short
field3                string(3)
                    END

Days        queue,static,thread
q             &aDayQueueType
            end

I then create the queue when I create a control on the window, thus:
     y#=lastfield()
     loop x#=y# to Y#+10 by 1
         CREATE(X#,CREATE:LIST,HoldParent)
         SETPOSITION(X#,XP#,YP#,WD#,HT#)
         X#{PROP:FORMAT}=?daymodel{PROP:Format}
         days.q &= new(aDayQueueType)
         X#{PROP:FROM}=Days.q
         unhide(x#)
         add(Days)
      end

Everything works as designed until I exit the procedure. This is the
code as it now exists for the "End of Procedure" embed point:

      get(days,1)
      loop until errorcode()
        if records(days.q) then
          free(days.q)
        end
        dispose(days.q)
        get(days,pointer(days)+1)
      end
      free(days)
      message('MADE IT THROUGH MY CODE OK, NOW LET'S SEE HOW TS DOES')

I get the message box, then the application freezes.  Is there something
wrong with this code?  If not, is there a work around?  Whatchathink?

TIA,
Harg



Thu, 22 Jun 2000 03:00:00 GMT  
 Queue of Queues problem.

Chris,

What file system are you using? If it is the TopSpeed file
system then this won't work. The pointer isn't a record
number. If it is the TopSpeed driver, then you cannot use
Get(file,1). This won't return the first record. You need to do
as my example below. Also, don't use the EOF() function for any
file system other than the Clarion file system. While
it is compatible, it will cause an additional read for
each cycle of the loop.

SET(Days)
Loop
   NEXT(Days)
   If ErrorCode() Then Break
End

HTH's
--
Michael Gould
TopSpeed Corporation - Consulting Divsion
Team TopSpeed - Internet

Quote:

>Hi all,

>Havin a bit of trouble with a calender function I'm working on.  The
>design calls for a queue of queues which seems to work accept when I
>return from the procedure. Here's the setup:

>aDayQueueType       QUEUE,type
>field1                long
>field2                short
>field3                string(3)
>                    END

>Days        queue,static,thread
>q             &aDayQueueType
>            end

>I then create the queue when I create a control on the window, thus:
>     y#=lastfield()
>     loop x#=y# to Y#+10 by 1
>         CREATE(X#,CREATE:LIST,HoldParent)
>         SETPOSITION(X#,XP#,YP#,WD#,HT#)
>         X#{PROP:FORMAT}=?daymodel{PROP:Format}
>         days.q &= new(aDayQueueType)
>         X#{PROP:FROM}=Days.q
>         unhide(x#)
>         add(Days)
>      end

>Everything works as designed until I exit the procedure. This is the
>code as it now exists for the "End of Procedure" embed point:

>      get(days,1)
>      loop until errorcode()
>        if records(days.q) then
>          free(days.q)
>        end
>        dispose(days.q)
>        get(days,pointer(days)+1)
>      end
>      free(days)
>      message('MADE IT THROUGH MY CODE OK, NOW LET'S SEE HOW TS DOES')

>I get the message box, then the application freezes.  Is there something
>wrong with this code?  If not, is there a work around?  Whatchathink?

>TIA,
>Harg



Fri, 23 Jun 2000 03:00:00 GMT  
 Queue of Queues problem.

Quote:

> Chris,

> What file system are you using? If it is the TopSpeed file
> system then this won't work. The pointer isn't a record
> number.

Hi Mike.

Thanks for looking at my problem. I'm not having trouble reading a file as
the file is not a file but a queue. I'm having trouble returning from a
procedure that contains a queue of queues.

Thanks for havin a look,
Harg

Quote:
> >Days    queue,static,thread
> >q             &aDayQueueType
> >            end

> >I then create the queue when I create a control on the window, thus:
> >     y#=lastfield()
> >     loop x#=y# to Y#+10 by 1
> >         CREATE(X#,CREATE:LIST,HoldParent)
> >         SETPOSITION(X#,XP#,YP#,WD#,HT#)
> >         X#{PROP:FORMAT}=?daymodel{PROP:Format}
> >         days.q &= new(aDayQueueType)
> >         X#{PROP:FROM}=Days.q
> >         unhide(x#)
> >         add(Days)
> >      end

> >Everything works as designed until I exit the procedure. This is the
> >code as it now exists for the "End of Procedure" embed point:

> >      get(days,1)
> >      loop until errorcode()
> >        if records(days.q) then
> >          free(days.q)
> >        end
> >        dispose(days.q)
> >        get(days,pointer(days)+1)
> >      end
> >      free(days)
> >      message('MADE IT THROUGH MY CODE OK, NOW LET'S SEE HOW TS DOES')

> >I get the message box, then the application freezes.  Is there something
> >wrong with this code?  If not, is there a work around?  Whatchathink?



Fri, 23 Jun 2000 03:00:00 GMT  
 Queue of Queues problem.

Hello Christopher Hargett.

Quote:
>aDayQueueType       QUEUE,type
>field1                long
>field2                short
>field3                string(3)
>                    END

Today I have solve same problem by relocating
QUEUE type definition (see above) to the global data section.

Best regards,
Vasiliy Goncharenko.
____________________




Sat, 24 Jun 2000 03:00:00 GMT  
 Queue of Queues problem.


Quote:

> ... If it is the TopSpeed driver, then you cannot use
> Get(file,1). This won't return the first record. You need to do

Is that a bug? If yes, when is it going to be fixed? If no, why is it so? -
it's such a pain to read the first record!

Jean-Marc



Sat, 24 Jun 2000 03:00:00 GMT  
 Queue of Queues problem.

Jean-Marc,

Mike is correct.  See the Help under the Topspeed driver.

--
Russell B. Eggen
Topspeed Corporation

[Outlook Express 4.01]


|>
|> ... If it is the TopSpeed driver, then you cannot use
|> Get(file,1). This won't return the first record. You need to do
|
|Is that a bug? If yes, when is it going to be fixed? If no, why is it so? -
|it's such a pain to read the first record!
|
|Jean-Marc



Sat, 24 Jun 2000 03:00:00 GMT  
 Queue of Queues problem.

It isn't a bug.  It has to do with the fact that the TopSpeed and Btrieve
file formats don't
use record numbers but a calculated relative record postion. To be generic
in your coding
it is better to use the example below for all file systems to get the first
record.

SET(filename)
   NEXT(filename)

--
Michael Gould
TopSpeed Corporation - Consulting Divsion
Team TopSpeed - Internet

Quote:


>> ... If it is the TopSpeed driver, then you cannot use
>> Get(file,1). This won't return the first record. You need to do

>Is that a bug? If yes, when is it going to be fixed? If no, why is it so? -
>it's such a pain to read the first record!

>Jean-Marc




Sat, 24 Jun 2000 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. CLASSes and QUEUEs (was: Re: QUEUE in QUEUE)

2. How to make a queue of queue's

3. Clarification of Queue Operation / Behavior when using multiple Queues

4. Queue in Queue?!

5. QUEUE in QUEUE

6. QUEUE inside GROUP/QUEUE

7. Queue.Queue examples?

8. Howto wait for multiple queues (Queue.py)?

9. Listbox and queue problem

10. Queue Problem

11. 16-bit queue size problem?

12. Problem with Clarion queue

 

 
Powered by phpBB® Forum Software