Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cargar list a tabla
Message
From
18/12/2006 17:57:28
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
18/12/2006 14:27:45
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01178428
Message ID:
01178743
Views:
22
>hola hilmar
>quiza no me explique bien
>ingreso desde varios cuadros de texto datos directos aun control list y ahi estan en el control list1 ahora bien esos datos quiero mandarlos ala tabla ventas .mi pregunta seria cual es la manera mas practica de grabar esos datos a la tabla ventas?
>gracias de antemano por tu respuestas

Bien, no estoy tan acostumbrado a trabajar con listas, pero experimentando un poco llegué a lo siguiente.

En un formulario, he creado una lista llamada "List1" (por lo visto, no me preocupé de darle nombres apropiados para esta prueba rápida...)

Las siguientes órdenes cargan el ListBox con datos de prueba:
with ThisForm.List1
	.AddItem("aaa")
	.AddItem("bbb")
	.AddItem("ccc")
endwith
Las siguientes órdenes extraen los elementos agregados anteriormente, mostrándolos en pantalla:
with ThisForm.List1
	for i = 1 to .ListCount
		MessageBox(.List(i))
	next
endwith
Seguramente es fácil adaptar esto para guardarlo en disco, por ejemplo (y esta última parte no la probé):
with ThisForm.List1
	for i = 1 to .ListCount
		insert into MiTabla(MiCampo) values (MessageBox(.List(i)))
		* o, alternativamente:
		append blank
		replace MiCampo with MessageBox(.List(i))
	next
endwith
HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform