View Full Version : Folder Structure Reference


03-20-2005, 09:19 PM
I have several questions related to file structure and handling:

1. Is there any way to reference files with a RELATIVE reference rather than an absolute path reference when programming an OnPush event to open a non-Alpha File. The folder would be in a sub-folder of the same folder where the application files are? I would prefer to do this rather than to mix other files in with the application files. Same goes for images that are referenced -- for example, pictures of people in the databse would be an "Images" folder rather than mixed in with the application files.

2. Same question also when opening another Alpha file. A hard path is always established, but I would like a relative path -- so I could set up a suite of Alpha5 apps that acess from one startup/menu app. It seems to me that with my computers hard path "wired" in, I'll be headed for problems on other's computers whose paths will be different.

3. When an install package is created, the associated folders are not included. Even associated files that are not A5 files but mixed in with the A5 files are not included. Is there a way to include such folders and/or files? For example, I have a Word Perfect document (*.wpd file) that I need to keep with the application since one of my menus has a button that opens that file.

Some help on these will be appreciated. Thanks.

Tom Cone Jr
03-20-2005, 11:30 PM

Using the Alpha Five Help file (available in the Learning Center) and a search key of DIRECTORY you can get a list of directory functions.

A5.get_path() will return the path to the current database.

A5.get_master_path() will do the same thing from a shadowed workstation

Using these functions you can get the actual path to the database folder even when you don't know it's name. Once the actual path is in a string variable you can concatenate the subfolder names to get a path to each of them, so long as they are subfolders of the database folder.

If you're not using the Alpha Five Help CHM you're working too hard.

-- t

03-21-2005, 06:07 AM
Thanks for steering me in that direction. I'll study that when I get a chance. The problem I find is that, being quite new to using Alpha 5, I read the instructions on the methods, etc but don;t know how and where to implement them. It seems the instructions have some dtail missing that ends up causing a roadblock. I know it's just because I have a WHOLE LOT MORE to learn.

Cheryl Lemire
03-23-2005, 04:24 AM

A sample of what Tom is talking about:

homefolder = A_DB_CURRENT_PATH
:A5.window_title = "Print Copies [Using Data in: "+homefolder+"]"

The above is in the OnActivate event of a form and is used to determine the Window Title that will display when that form is activated. The above would result in the forms window title being:

Print Copies [Using Data in: c:\db\directory_name]

It sounds like you would know the sub directory names so you could add to the 'homefolder' things like \images, etc.

Hope that helps.
Good luck