Dim Fields in Queue for LIST Box shows 10 : Parameter typing error

Trying to show a queue with dim fields in a list box.
I get an error as soon as the window opens.

TestQueue Queue(),Pre()
Name String(20)
DimStr String(20),Dim(20)
  End 

If I create a window with the Name and DimStr[1] in a listbox I get an error:
Unknown Error Posted : 10 : Parameter typing error

I am sure I remember usinig dim in topspeed files and showing the fields in a browse.
I must be missing something but what???
QueueTest.zip (38.1 KB)

You cannot use DIM() fields in a Queue that feeds a LIST. As you saw you get an error at runtime.

The more difficult workaround is to use a VLB (aka Virtual List Box or VLBProc) where you supply a callback that can supply the data using any Queue, File or method. VLB’s work very well.

The simplest workaround is to use OVER() like:

TestQueue Queue(),Pre()
Name String(20)
DimStr_1 String(20)   !was DimStr String(20),Dim(20)
DimStr_2 String(20)   !now have 20 STRING(20) fields
... 3 - 18 ...
DimStr_19 String(20)
DimStr_20 String(20)
End

DimTestQueue GROUP(),Pre(DimTestQ) ,OVER(TestQueue)
Name String(20)
DimStr String(20),Dim(20)
   End

You can have a GROUP in the Queue which is nice so you just Over the Array. But you must count that Group as a Field and skip that Field in your Format using #Field#. Not sure if that can work with a Browse template.

TestQueue Queue(),Pre()
Name String(20)
DimStr_Group  GROUP,PRE()  !Will be Field #2#
DimStr_1 String(20)        !Will be Field #3#
DimStr_2 String(20)
... 3 - 18 ...
DimStr_19 String(20)
DimStr_20 String(20)
       End  !Group
   End

DimStr String(20),Dim(20) , OVER(DimStr_Group)

My LIST Format Tool can be helpful. You can paste in any FORMAT() string and it will preview a working LIST fed by test data using VLB.


The Browse Template makes its own Queue that will not have DIM fields, it will just have the Subscript(s) you picked.

Another option is to use a VLBProc to serve the data

Not important, but Carl had already mentioned that in his detailed response.

1 Like