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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vfp-6 Combo filling with a stored value

Status
Not open for further replies.

wetton

Technical User
Jun 26, 2006
42
AU
I am using a combo based on a single element array to select a path to be used in the app.

I store the selected value in an ini file entry and write all used paths to a table.

The array is created from the table when the app opens

I want the combo to show the previously used path stored in the ini file.

The 3 situations in the ini file are

1 blank
2 drive letter and root
3 a full path

The third choice is the one I want to show if that is in the ini - or the first element of the array if situations 1 or 2 exist.

I have tried various ways of getting the value into the combo in the init method - I guess there is a better/more correct way.

Any ideas anyone?

Thanks

PW
 
I have finished up with a workable solution - this code is in my mainform.init

Code:
myfirstentry = .t. or .f. from inifile

	
	IF myfirstentry = 'true'

		.cboselectpath.value = aListpaths[1] ( this will always be a valid path - previously inserted into array in  main.prg

		change myfirstentry to .f. in ini

	ELSE
	
		myelement  = from previous value - in ini file

		.cboselectpath.value = aListpaths[myelement]

	ENDIF

	mynewpath = .cboselectpath.value

	.cboselectpath.setfocus

Thanks Geoff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top