Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change Order of a set of data
Message
De
05/04/2002 10:48:02
 
 
À
05/04/2002 09:09:26
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00641277
Message ID:
00641458
Vues:
11
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform