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

load drop down list based on user input

Status
Not open for further replies.

jmeckley

Programmer
Jul 15, 2002
5,269
US
I have inherited a custom foxpro 2.5 application that now needs to be updated (the code, not the version). I have never worked with foxpro before. I come from an asp.net background. This is the first time I have ever seen foxpro. I have a reference manual and small developers guide that came with the software package which has helped to some degree.

I need to add a drop down list to a screen file. The drop down list will be populated with choices depending on the record id.

while experimenting I have been able to create the following function which loads the item numbers into a referenced array.
Code:
FUNCTION getItemNum
PARAMETER items, subassembly

SELECT itemnum FROM g:\jason\obams\proditem WHERE product_id = subassembly ORDER BY itemnum INTO ARRAY items
USE

RETURN .T.
-----------------------------
example:
CLEAR
DIMENSION b[1,1]
x = getItemNum (@b, 1)
DISPLAY MEMORY LIKE b
How can I point the populated array to the drop down list?

also, what is the purpose for all the different file types for screens (reports, programs and queries for that matter)?
spr, spx, scx, sct

Thank you for your help

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Sorry but I can't help with the drop down - I'm too rusty with Fox 2 to be able to talk you through it blind.

I can answer your second question though.

Foxpro tables store their data in a dbf file and their memo fields in an fpt file. FoxPro also stores screen and report design in files of the same format. The data for a screen design lives in the scx file, the memo fields live in the sct file.

The FoxPro Screen Builder stores the design of the form in this table then builds a program file (of type spr) to implement the design. The spr is a text file and you'll find it full of commands like:

@11.769,21.600 SAY "Print"

Obviously Fox can't run a text file. The spx file is the compiled version of the spr.

All this sounds crude but bear in mind that:

a: You're working with technology that's 15 years old, Visual Fox is very different.
b: Fox was cross-platform back then. The screen could be compiled for DOS, Windows, Mac or Unix.

Sorry I can't help with the big problem but I'm sure someone from this forum will remember the technique.

Geoff Franklin
 
I'm pretty rusty with this stuff, too, but just open FoxPro 2.6 to check.

Open the existing screen and from the Screen menu, choose List (or Popup, if that's what you want). The dialog that appears offers array as one of the choices for the source. Provide the name of the array you're using and take it from there.

When FoxPro 2 came out in 1989 or 1990, the ability to do this stuff was way beyond anything most of us had seen to that point.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top