Bonjour,
comment mettre des fichiers (file1.dbf ,...,files.dbf) qui sont dans un repertoire(c:\directory\*.dbf)) dans listbox et ouvrir une des tables.
merci d'avance
Hello,
how to put files (file1.dbf ,...,files.dbf) which are in a directory (c:\directory\*.dbf) in listbox and open one of the tables.
thank you in advance
ARRAY -- ESTOY BLOQUEADO..
Moderator: Rathinagiri
Re: ARRAY -- ESTOY BLOQUEADO..
L'Algerie vous salut
Y.TABET
Y.TABET
- SALINETAS24
- Posts: 667
- Joined: Tue Feb 27, 2018 3:06 am
- DBs Used: DBF
- Contact:
Re: ARRAY -- ESTOY BLOQUEADO..
Hola Tonton2, aqui tienes un ejemplo de lo que quieres. Espero que te sirva.tonton2 wrote: ↑Wed Jan 11, 2023 11:05 am Bonjour,
comment mettre des fichiers (file1.dbf ,...,files.dbf) qui sont dans un repertoire(c:\directory\*.dbf)) dans listbox et ouvrir une des tables.
merci d'avance
Hello,
how to put files (file1.dbf ,...,files.dbf) which are in a directory (c:\directory\*.dbf) in listbox and open one of the tables.
thank you in advance
- Attachments
-
- LISTBOX_2.rar
- (1.21 MiB) Downloaded 80 times
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. 

Re: ARRAY -- ESTOY BLOQUEADO..
Bonjour,
En voulant ouvrir cFile := (BL_Produit.dbf) ,le message suivant apparait, avez une idée pour résoudre ce problème
Bonsoir,
Hello,
When wanting to open cFile:= (BL_Produit.dbf), the following message appears, do you have an idea to solve this problem
En voulant ouvrir cFile := (BL_Produit.dbf) ,le message suivant apparait, avez une idée pour résoudre ce problème
Bonsoir,
Hello,
When wanting to open cFile:= (BL_Produit.dbf), the following message appears, do you have an idea to solve this problem
- Attachments
-
- Listbox.rar
- (1.21 MiB) Downloaded 69 times
-
- Capture.JPG (33.52 KiB) Viewed 992 times
L'Algerie vous salut
Y.TABET
Y.TABET
Re: ARRAY -- ESTOY BLOQUEADO..
Bonjour,SALINETAS24 wrote: ↑Wed Jan 11, 2023 1:33 pmHola Tonton2, aqui tienes un ejemplo de lo que quieres. Espero que te sirva.tonton2 wrote: ↑Wed Jan 11, 2023 11:05 am Bonjour,
comment mettre des fichiers (file1.dbf ,...,files.dbf) qui sont dans un repertoire(c:\directory\*.dbf)) dans listbox et ouvrir une des tables.
merci d'avance
Hello,
how to put files (file1.dbf ,...,files.dbf) which are in a directory (c:\directory\*.dbf) in listbox and open one of the tables.
thank you in advance
Avez vous une idée comment contourner ce probleme
merci.
Do you have any idea how to get around this problem?
thank you
¿Tienes alguna idea de cómo solucionar este problema?
Gracias
L'Algerie vous salut
Y.TABET
Y.TABET
Re: ARRAY -- ESTOY BLOQUEADO..
Hello,tonton2 wrote: ↑Thu Jan 12, 2023 11:11 amBonjour,SALINETAS24 wrote: ↑Wed Jan 11, 2023 1:33 pmHola Tonton2, aqui tienes un ejemplo de lo que quieres. Espero que te sirva.tonton2 wrote: ↑Wed Jan 11, 2023 11:05 am Bonjour,
comment mettre des fichiers (file1.dbf ,...,files.dbf) qui sont dans un repertoire(c:\directory\*.dbf)) dans listbox et ouvrir une des tables.
merci d'avance
Hello,
how to put files (file1.dbf ,...,files.dbf) which are in a directory (c:\directory\*.dbf) in listbox and open one of the tables.
thank you in advance
Avez vous une idée comment contourner ce probleme
merci.
Do you have any idea how to get around this problem?
thank you
¿Tienes alguna idea de cómo solucionar este problema?
Gracias
Please try the updated example below.

Code: Select all
/*
* Ejemplo para Listbox + Directory para TONTON2
* Salineta24 - Petrer City (Alicante - SPAIN)
* Email : SARGANTANTASOFT@GMAIL.COM
*/
#include "hmg.ch"
FUNCTION Main
LOCAL nFor, cCarpeta
LOCAL aNombreFiles:={} // Solo se usa para la definicion del listbox
DEFINE WINDOW Win1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 400 ;
TITLE 'CARGAR FICHERO DBF' ;
MAIN
DEFINE MAIN MENU
DEFINE POPUP "File"
MENUITEM "Cargar DBF" ACTION cCarpeta:=CargarDbf()
SEPARATOR
MENUITEM "Salir" ACTION ThisWIndow.Release
END POPUP
END MENU
@ 10,10 LISTBOX LIST1 ;
WIDTH 100 HEIGHT 200 ;
ITEMS aNombreFiles ;
ON DBLCLICK EjecutaDBF(cCarpeta)
END WINDOW
Win1.Center
ACTIVATE WINDOW Win1
RETURN
FUNC CargarDBF
LOCAL nFor, cCarperta
LOCAL aTotalFiles:={}
// Carga Directorio
cCarpeta:=GetFolder("Directorio DBFґs")
aTotalFiles:=Directory(cCarpeta+"\*.DBF")
// Borro todo el Listbox
DoMethod ( "Win1", "List1", 'DeleteAllItems' )
FOR nFor=1 To LEN(aTotalFiles)
DoMethod ( "Win1", "List1", 'AddItem', aTotalFiles[nFor][1] )
NEXT
RETURN cCarpeta
PROC EjecutaDBF(cCarpeta)
LOCAL cFile
LOCAL nPos
nPos:=Win1.List1.Value
IF nPos=0
MSGBOX("Error en seleccion")
ELSE
cFile:=Win1.List1.item(nPos)
msgbox("FICHERO "+cCarpeta+"\"+cFile)
use (cCarpeta+"\"+cFile) // Ajout
COPY STRUCTURE TO Gest_ant FIELDS REFERENCE,PRIX_TOTAL,QUANTITE0
Use Gest_Ant
APPEND FROM (cCarpeta+"\"+cFile) FIELDS REFERENCE,PRIX_TOTAL,QUANTITE0
EDIT EXTENDED
ENDIF
RETURN
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Re: ARRAY -- ESTOY BLOQUEADO..
Thank you very much. I'll test your sample and btw I found a solution. I'll soon send you minegfilatov wrote: ↑Thu Jan 12, 2023 1:54 pmHello,tonton2 wrote: ↑Thu Jan 12, 2023 11:11 amBonjour,SALINETAS24 wrote: ↑Wed Jan 11, 2023 1:33 pm
Hola Tonton2, aqui tienes un ejemplo de lo que quieres. Espero que te sirva.
Avez vous une idée comment contourner ce probleme
merci.
Do you have any idea how to get around this problem?
thank you
¿Tienes alguna idea de cómo solucionar este problema?
Gracias
Please try the updated example below.![]()
Code: Select all
/* * Ejemplo para Listbox + Directory para TONTON2 * Salineta24 - Petrer City (Alicante - SPAIN) * Email : SARGANTANTASOFT@GMAIL.COM */ #include "hmg.ch" FUNCTION Main LOCAL nFor, cCarpeta LOCAL aNombreFiles:={} // Solo se usa para la definicion del listbox DEFINE WINDOW Win1 ; AT 0,0 ; WIDTH 400 ; HEIGHT 400 ; TITLE 'CARGAR FICHERO DBF' ; MAIN DEFINE MAIN MENU DEFINE POPUP "File" MENUITEM "Cargar DBF" ACTION cCarpeta:=CargarDbf() SEPARATOR MENUITEM "Salir" ACTION ThisWIndow.Release END POPUP END MENU @ 10,10 LISTBOX LIST1 ; WIDTH 100 HEIGHT 200 ; ITEMS aNombreFiles ; ON DBLCLICK EjecutaDBF(cCarpeta) END WINDOW Win1.Center ACTIVATE WINDOW Win1 RETURN FUNC CargarDBF LOCAL nFor, cCarperta LOCAL aTotalFiles:={} // Carga Directorio cCarpeta:=GetFolder("Directorio DBFґs") aTotalFiles:=Directory(cCarpeta+"\*.DBF") // Borro todo el Listbox DoMethod ( "Win1", "List1", 'DeleteAllItems' ) FOR nFor=1 To LEN(aTotalFiles) DoMethod ( "Win1", "List1", 'AddItem', aTotalFiles[nFor][1] ) NEXT RETURN cCarpeta PROC EjecutaDBF(cCarpeta) LOCAL cFile LOCAL nPos nPos:=Win1.List1.Value IF nPos=0 MSGBOX("Error en seleccion") ELSE cFile:=Win1.List1.item(nPos) msgbox("FICHERO "+cCarpeta+"\"+cFile) use (cCarpeta+"\"+cFile) // Ajout COPY STRUCTURE TO Gest_ant FIELDS REFERENCE,PRIX_TOTAL,QUANTITE0 Use Gest_Ant APPEND FROM (cCarpeta+"\"+cFile) FIELDS REFERENCE,PRIX_TOTAL,QUANTITE0 EDIT EXTENDED ENDIF RETURN
L'Algerie vous salut
Y.TABET
Y.TABET
Re: ARRAY -- ESTOY BLOQUEADO..
RE ,
Voila finalement une partie du programme solutionné
Here is finally a part of the solved program
Aquí está finalmente una parte del programa resuelto.
Merci a tous pour votre Aide
Voila finalement une partie du programme solutionné
Here is finally a part of the solved program
Aquí está finalmente una parte del programa resuelto.
Merci a tous pour votre Aide
- Attachments
-
- CAIS_WINRAR.rar
- (1.21 MiB) Downloaded 98 times
L'Algerie vous salut
Y.TABET
Y.TABET