Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox - rowsource Files - how to?

Status
Not open for further replies.

ofcalcul

IS-IT--Management
Sep 28, 2004
24
RO
I have a listbox control on a form which has the following properties:

RowSourceType = 7 - Files
RowSource = "*.csv"

When I run the form, the listbox allows me to go to another directory or another disk drive to locate a file. When I select the file i need, in the List property I only found the filename of the file I selected, and not the entire path.
How can I determine the complete path to the selected file?

Thank you,
Cristian
 
ofcalcul

Take a look at FULLPATH().Here is an example.
Code:
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT list1 AS listbox WITH ;
		RowSourceType = 7, ;
		RowSource = ['"*.csv"'], ;
		Height = 205, ;
		Left = 60, ;
		Top = 12, ;
		Width = 229, ;
		Name = "List1"


	PROCEDURE list1.DblClick
		MESSAGEBOX(FULLPATH(this.Value))
	ENDPROC


ENDDEFINE

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
It still doesn't work. When I go to a file in another directory, MESSAGEBOX(FULLPATH(this.Value)) it shows me a wrong path made like this:

curdir()+the_file_name.csv

But I went to another directory than curdir()!


Thank you, anyway
Cristian
 
You might need to change

Set Default To (MyNewDir)



boyd.gif

 
How does fullpath(getfile('csv')) work for you?

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top