- Details
- Category: Tips
- Hits: 4561
- Details
- Category: Tips
- Hits: 2418
We create a small datastore and use it to sort our array.
datastore lds_temp string ls_err integer i // change the datastore definition according to the array data type long ll_array[] = { 2 , 3, 6, 5 } string ls_dsdef = & 'release 6; datawindow() table(column=(type=long name=a dbname="a") )' lds_temp = CREATE datastore lds_temp.Create(ls_dsdef, ls_err) // put the array in the datastore lds_temp.object.a.current = ll_array lds_temp.SetSort("a ASC") lds_temp.Sort() // get back the array ll_array = lds_temp.object.a.current FOR i = 1 to Upperbound(ll_array) MessageBox("", string(ll_array[i])) NEXT DESTROY lds_temp
Original in: http://www.rgagnon.com/
- Details
- Category: Tips
- Hits: 3814
Place a rectangle with a transparent background color. Place fields on the rectangle. In the expression tab for the rectangle, in the backgound color field :
if ( mod(getrow(),2) = 0, oneColor, anotherColor )
Original Autor: http://www.rgagnon.com/
- Details
- Category: Tips
- Hits: 5778
First, define a user event to correspond with the pbm_dwnprocessenter event on a datawindow. Then in that event :
Send(Handle(this),256,9,Long(0,0))
RETURN 1
Original Autor: http://www.rgagnon.com/
- Details
- Category: Tips
- Hits: 11126
This article describes how to click on the header of a datawindow, allows the datawindow to be ordered by that column. The name of the column header must have the same name as in the database and finish in _t
For example:
Column name: emp_id
Header name: emp_id_t
You can only sort by one column at a time.
Read more: How to sort a datawindow by clicking on the column header
- Details
- Category: Tips
- Hits: 4002
This tip was submitted by This email address is being protected from spambots. You need JavaScript enabled to view it..
Here is a clever datawindow trick which determines if there are duplicate rows in the datawindow before saving to the database. In the example below, the unique key in the database is "user_id", so what we are doing here is sorting them and then filtering in a way which leaves only the duplicate rows. If the row count is greater than zero after the sort, there is a problem... no looping necessary!
Page 1 of 2