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

VFP-6 Populating a combobox from aListPaths 2

Status
Not open for further replies.

webmonger

Programmer
Mar 13, 2004
66
0
0
AU
I have an application that I developed last year and am upgrading.

I've moved to a pageframe control which works very well.

My problem is with a 'previous path' selection combo. this has worked for ages with the following code to populate in in the main form's init procedure


Code:
cTablename = "paths"
IF file(cTablename+".dbf")
	IF !USED(cTablename)
		USE (cTablename) in 0
	ENDIF
	SELECT (cTablename)
	GO top
*!*		COPY to temp
	IF reccount() >0
		SELECT myPath FROM paths INTO ARRAY aListPaths
		IF VARTYPE(aListPaths) = "U"
			DIMENSION aListPaths(1)
			aListPaths(1) = ""
		ENDIF
		

	ELSE

		DIMENSION aListPaths(1)
		aListPaths(1) = ""
	ENDIF
ENDIF

Now I only see one entry when I get to that page (page1).

I just don't know what combo property or code line could do that to me. Can anyone suggest anything to get me out of my misery?

Thanks

Bryan
 
HI

I would replace the whole of above code with following..
I assume you do not need the paths table to remain open for any other processing.

Code:
DIMENSION aListPaths(1)
IF file("paths.dbf")
   SELECT myPath FROM paths INTO ARRAY aListPaths
ENDIF

____________________________________________
ramani - (Subramanian.G) :)
 
Thanks again Ramani

Was your code for a similar situation some years ago <G>

I have replace the code and still have the problem. Both versions do it.

I removed the combo and put a new one on the page1.

I ran Builder and nominated the aListPaths array.

No procedures were changed.

When I run exe I still see only one row.

I investigated with some listcount values and alen(aListPaths) to labels on the form.

I see the array as having 5 elements and the combo showing 1 both on init and when clicked.

Something else is restricting the rows showing in the combo.
But what could do that?

thanks

Bryan


 
Bryan,

3 questions..

I assume that the original exe still shows 5 items in the combo?

In the new version, is the item in the combo the same as the first element in the array?

What are the values of the 5 elements in the array?

Stewart
 
HI

Is the first character \ in the paths list ?

Combobox will ignore the rows having \ as the first character.

Probably use a dummy character or a drive letter as your first character for the combo. OR use a grid to imitate the combo box and replace the combo with the grid.

:)

____________________________________________
ramani - (Subramanian.G) :)
 
Stewart

1 - Yes

2 - Yes

3 - Previously selected paths.

The idea is that a 3rd Party application stores projects ( Genealogy)in a user determined folder. Within that folder can be a number of projects.

So on Page 1 they select the folder to investigate.

And on page 2 they get a combo with the list of available projects ( foxpro database based)

This combo is based on an array also and works correctly. I will try and code a grid as ramani suggests until a cause is found.

The app is at
Thanks for your UK interest

Bryan - ex Gillingham Kent
 
My immediaie problem is solved. After writing a new code segment to add a particular path to the array all entries appear. So it's a mystery that will remain unsolved - until it happens again. somehow the array was out of scope.

Thanks

Bryan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top