on 09-18-2014 2:49 PM
I have a datawindow dw_1. I use following script to move all data from Primary buffer to Delete buffer.
dw_1.RowsMove(1, dw_1.RowCount(), Primary!, dw_1,1, Delete!)
Then I want to find out a row in Delete buffer like dw_1.Find(...).
How can I do it? If all datawindow functions can be applied for Delete buffer?
Hi Kent;
Unfortunately, the DW does not support a buffer option on the Find ( ) method and is thus limited to the Primary buffer.
As an alternative, you can use the DOT notation or the RowsMove ( ) method to access the Delete buffer and copy those to a DataStore's primary buffer. Now you could use the Find ( ) method on the DS to locate your information. The row number in the DS should be the same as the row number in the DW control (unless you have sorting or filtering active). Thus, the DS becomes your index into the DC's Delete buffer.
HTH
Regards ... Chris
PS: What you are looking for would be a great feature enhancement - not only for the Find ( ) - but for all DC/DS methods that do not have the buffer option.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chris, hi Kent,
there is a buffer option on the find () method since PB 12.1.
But it is only documented as new feature. The documentation of the find() function was not updated.
Hi René ;
OMG .. you are 100% correct and I seem to remember reading about that enhancement a few years ago now that you mention it.
Looking in the 12.1 & 12.5.1 HELP for the Find method does not show a buffer option in the syntax. So it looks like SAP needs to open a documentation ticket on this!
----------------------------- HELP -----------------------------------------
[PowerBuilder and Web DataWindow server component]
long dwcontrol.Find ( string expression, long start, long end )
----------------------------------------------------------------------------------
However, using AutoScript ....
THIS.Find( /*readonly string s*/, /*long b*/, /*long e*/, /*dwbuffer d */)
Regards ... Chris
Hi Moshe;
Yes, this feature has been there in PB Classic for over a Decade. Originally written by Reed Shilts of Sybase many moons ago. You can activate the AutoScript feature in any script-able painter from the top IDE menu DESIGN => OPTIONS => AUTOSCRIPT
I would recommend checking all the boxes EXCEPT the "Activate Only After Dot". Plus, I personally like the delay time at 700 milliseconds.
HTH
Regards ... Chris
Two options:
1. As suggested by Ludwin - create a DS and copy the rows from the delete buffer to the DS and Find() from there.
2. Loop through the deleted rows and find what you're looking for, one row at a time.
Personally, I prefer number 1.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
BTW. Wouldn't it be better to find the row before you move it into the deleted buffer?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is a great suggestion Ludwin!
Kent: Use a DW expression on the "Visible" property to control "logical deletes". This would make them still in the primary buffer and searchable via the FIND. On the deletion process, now you can copy these logical deletes to the actual Delete buffer and process from there.
Though find() does not work in the deteted buffer you could
- create a datastore,
- assign the dataobject
- sharedata
and then use find() on this datastore.
HTH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.