PxPlus User Forum

Twitter Twitter Twitter

Recent Posts

Pages: [1] 2 3 ... 10
1
Programming / Re: How to speed up creating a Tree View List Box
« Last post by Dave Fullerton on September 21, 2019, 05:24:38 AM »
Hi Ken:

Thanks for the tips. I'm wondering if the 'sort=0 may be the key to my issue.  I'll give it a shot.

Regards

Dave Fullerton
2
Programming / Re: How to speed up creating a Tree View List Box
« Last post by ksproul on September 20, 2019, 06:17:23 PM »

Dave,


With Mike King's help I was able to dramatically improve performance by doing the following:
1. Pre-sort the data using a memory file with a key definition that defines the each level as fields
2. Build a load string from the memory file.
3. Turn off the list box sorting feature ('sort=0).
4. Loading the data using the string.
5. Turn the list box sorting back on ('sort=1)


Mike explained that the performance was due to an inefficient built-in sorting mechanism with the windows list box control. So far we haven't exceeded the memory limits and we've loaded a lot more than 80k records with up to 6 levels.

3
Programming / How to speed up creating a Tree View List Box
« Last post by Dave Fullerton on September 20, 2019, 04:59:19 PM »
Hi folks:

We have a routine where the structure of a user defined financial statement gets transferred to a tree view list box.  There are four levels in this list box - a major group, a minor group, a line group, and then line details.  There are no graphics displayed.  Our client has one report that contains 81,141 lines to be loaded into the list box.

The user is in a WindX environment, on a Windows network.  They are running PxPlus V15. 

I hide the list box before displaying anything.  All data is loaded a line at a time.  After 65 minutes, approximately 77,000 records had been processed.  This is obviously waaaay too slow.  I had thought about putting everything into a variable to load everything at once, but I'm worried about error 31's.

Does anyone have any suggestions how to speed up the processing?

Thanks in advance

Dave Fullerton
4
Programming / Re: Selecting all list_box entries
« Last post by ksproul on September 20, 2019, 04:03:53 PM »
Mike, maybe you could add a select all method that does the same thing as ctrl-a.  :)
5
Programming / Re: Selecting all list_box entries
« Last post by James Zukowski on September 20, 2019, 03:32:31 PM »
That's basically what I got from RobL above, and it works fine. Just looking for the easier (as usual).
6
Wish List / Re: Training video on v2020 Enhanced File Maintenance Wizard
« Last post by Mike King on September 20, 2019, 03:15:17 PM »
Over the coming months we are looking at adapting some of the presentations into Videos and adding them to our Video Library in the "Knowledge Base" section of this forum.
7
Programming / Re: Selecting all list_box entries
« Last post by Mike King on September 20, 2019, 03:12:02 PM »
James

To select ALL entries try:

LIST_BOX FIND lbHandle, 0, allItems$
LIST_BOX WRITE lbHandle, allItems$
8
Programming / Re: Selecting all list_box entries
« Last post by James Zukowski on September 20, 2019, 09:45:46 AM »
Fortunately, in our case, we're only dealing with a couple of hundred entries max in 3 lists, so it's going to be quick whichever way we go. The for/write/next was visible, since I didn't hide the list_box first, and it looked a little flashy. Using the find/write all works really well in this situation.
9
Programming / Re: Selecting all list_box entries
« Last post by ksproul on September 19, 2019, 09:33:25 PM »
If the data in the list box is large, reading and writing it to select everything may be time consuming, especially in a client/server environment.  An example with 5,000 items in the list using an alternative method is shown below.  Un-remark line 220 to see the difference in time using the read/write method.  In my tests over a client/server internet (not intranet) connection took almost 4 times longer to select all of the items using the read/write method.

0010 begin
0015 print 'CS',
0020 precision 8
0025 list_box 10,@(10,5,40,10),opt="#"
0030 print "Loading ... ",; wait 0; t=tim
0035 for i=1 to 5000
0040 list_box load 10,0,str(rnd(10000):"0000")+str(rnd(10000):"0000")
0045 next i
0050 print @(0),"elapsted seconds:",(tim-t)*3600; wait 0
0055 print "Selecting ... ",; wait 0; t=tim
0060 selected=fn_lb_select_all(10)
0065 print "elapsed seconds:",(tim-t)*3600; wait 0
0070 list_box goto 10
0075 obtain "Press Enter to end",*,'LF'
0080 list_box remove 10
0085 end

0200 def fn_lb_select_all(local id)
0205 local items=id'itemcount,i,p$,v$
0210 if items then {
0215 list_box hide id
0220 ! list_box find 10,0,x$; list_box write 10,x$; goto 0235
0225 for i=items to 1 step -1; p$+=",selectitem",v$+=sep+str(i); next i
0230 id'_proplist$=p$(2),id'_propvalues$=v$(2)
0235 list_box show id
0240  }
0245 return items
0250 end def
10
Wish List / Re: Training video on v2020 Enhanced File Maintenance Wizard
« Last post by HendersonS on September 19, 2019, 06:48:56 PM »
hey ! Could you share these files for those who couldn't go to?
Pages: [1] 2 3 ... 10