Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change Order of a set of data
Message
From
05/04/2002 10:48:02
 
 
To
05/04/2002 09:09:26
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00641277
Message ID:
00641458
Views:
10
Agnes,

if the # of records is not too big, try this and forget 2^p

Form.load
create cursor PS ;
	(	p_Order	I		Default 0, ;
		p_name	c(20)	default '' ;
	)

select ps
for i=1 to 10
	insert into ps(p_order, p_name) values(i, 'p_'+str(i,18,0))
endfor

index on bintoc(p_Order) tag p_Order

go top in ps
put following in a Click of the grid ( I prefer the left upper box of the grid)
local i, p, r, LockScreen

p = sys(2015)

define popup (p) from mrow(), mcol() margin mover Scroll color scheme 13 

select (this.RecordSource)

local r, Records[1], n

r = recno()
n = 0
go top
scan all	&& current order
	n = n + 1
	dime Records[n]
	Records[n] = recno()
	define bar cntbar(p)+1 of (p) prompt p_name
endscan

activate popup (p)

LockScreen = thisform.LockScreen
thisform.LockScreen = .T.

local NewPos

select (this.RecordSource)
for i = 1 to n
	NewPos = getbar(p, i)
	
	if( (i <> NewPos) )
		go (Records[NewPos])
		repl p_order with i
	endif
endfor

go top && go (r)


this.Refresh()


thisform.LockScreen = LockScreen
release popup(p)
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform