` Printed Icetips Article

Icetips Article



Browses and Listboxes: Using a queue reference in a listbox
2004-03-09 -- Jim Gambon
 
Newsgroups: softvelocity.public.clarion6


Hi Robert,

> Can someone help me out with something not working.

Attached is a small hand-coded experiment showing the technique of NOT
putting a FROM attribute on the list control, and, then, at run-time, use
the {PROP:From} property assignment. The docs for C55 and C6 both show that
this is a read-only property for LISTs, but I wanted to try and make it
work, and it does. It seems the docs are wrong, or I'm reading them
incorrectly.

Let us know if this helps out. It doesn't cross threads, but it should get
you going.

Regards,

Jim Gambon

You can download the QRefList.ZIP file here.

QRefList.prj:

-- Queue Ref Listing
#noedit
#system win32
#model clarion dll
#pragma debug(vid=>full)
#compile "QRefList.CLW"
#link "QRefList.exe"


QRefList.clw:

    PROGRAM

AQueueType  QUEUE,TYPE
ALong         LONG
AString       STRING(40)
            END !QUEUE

    MAP
LoadQ   PROCEDURE(*AQueueType  TheQ)
    END !MAP


AQRef   &AQueueType

Window WINDOW('A Window'),AT(,,260,100),SYSTEM,GRAY
       LIST,AT(5,4,250,91),USE(?List1),HVSCROLL,|
         FORMAT('47L(2)|M~TheLong~@N_10@40L(2)|M~TheString~@S40@')
     END

    CODE

    AQRef &= NEW(AQueueType)

    LoadQ(AQRef)

    OPEN(Window)
    ACCEPT
      IF EVENT() = EVENT:OpenWindow
        ?List1{PROP:From} = AQRef
      END !IF
    END
    CLOSE(Window)    ! Must Close Window before disposing the Queue

    FREE(AQRef)
    DISPOSE(AQRef)

    RETURN


LoadQ   PROCEDURE(*AQueueType  TheQ)
Counter     LONG
    CODE

    LOOP Counter = 1 TO 100

      TheQ.ALong = Counter
      TheQ.AString = 'List Item: ' & FORMAT(Counter,@N08)
      ADD(TheQ)

    END !LOOP

    RETURN



Printed November 23, 2024, 2:12 am
This article has been viewed/printed 35399 times.
Google search has resulted in 23 hits on this article since January 25, 2004.