Thanks Mike & Jan.
I had thought about a temp table but as this had been acceptably fast in the
past I had held that back in case nothing else came up.
The “Load from file” method was quick to implement and just needed some WIDTHS
set to accommodate the NOTE field and was super quick.
Regards,
Alastair.
If anyone’s interested, I ended up with this:
-- All_Comments_Menu On After Start EEP ... Date of last amendment: 22/02/2011
SET HEADINGS OFF
SET WIDTH 500
SET SELMARGIN 1
OUTPUT LISTBOX.FLE
SELECT DISTINCT Long_Comments=500 +
FROM All_Comments +
WHERE Long_Comments NOT CONTAINS 'G:\' +
ORDER BY Long_Comments ASC
OUTPUT SCREEN
PROPERTY IDLB_CommentsMenu Load_From_File 'LISTBOX.FLE'
ERASE LISTBOX.FLE
SET HEADINGS ON
SET WIDTH 100
SET SELMARGIN 0
RETURN
From: Mikeb
Sent: Monday, February 21, 2011 11:36 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: v9.1 on W9/64 - List Box query
Alastair,
Load your list box using the Load_From_File...
Don't use the cursor, just do this:
Set Headings Off
Out Listbox.Dat
SELECT DISTINCT Long_Comments +
FROM All_Comments +
WHERE Long_Comments NOT CONTAINS 'G:\' +
ORDER BY Long_Comments ASC
out scr
Property YourListBoxCompID Load_From_File 'Listbox.Dat'
The response will be less than moments...
----- Original Message -----
From: "Alastair Burr" <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Monday, February 21, 2011 1:12 PM
Subject: [RBASE-L] - v9.1 on W9/64 - List Box query
I have a (rarely used) form that is a Variable User List List Box with two
buttons that now takes approaching 5 minutes to prepare the data when v7.6
took only a few moments.
This is the relevant code that prepares the list:
DECLARE C1 CURSOR FOR SELECT DISTINCT Long_Comments +
FROM All_Comments +
WHERE Long_Comments NOT CONTAINS 'G:\' +
ORDER BY Long_Comments ASC
OPEN C1
FETCH C1 INTO vAddList
WHILE SQLCODE = 0 THEN
PROPERTY IDLB_CommentsMenu LISTITEMSADD .vAddList
FETCH C1 INTO vAddList
ENDWHILE
The selection command currently returns 3459 rows when using Browse almost
instantly.
I notice, too, that I can no longer use the mouse’s scrolling wheel to move
the data up or down – whether a row is selected or not.
Has anything changed that means I need to revamp my code?
Regards,
Alastair.