GIS_Mike
Jul 27th, 2005, 07:35 AM
Hi all
I'm afraid I know the answer to this already, but...
I have a user form that asks for a file to open. When the user clicks the browse button, a function creates a browse window and allows the user to select a file. The function returns the file name and path to the form (i.e. C:\DooDoo\stinky.dog). When the user clicks the "Open" button this file path is passed along so the program can do all sorts of inappropriate things.
What I was wondering, is it possible to get a function to return multiple values? Ideally, I would have two variables, one for the path (C:\DooDoo) and one for the file name (stinky.dog).
When you tell me that this isn't possible, how then do I split the two? I can't foresee using some string manipulations as the length of the path and file name will vary. Unless I did some sort of backwards string counting that split the string at the backslash before the file name.
Oh bother.
Is it possible to make a function hold an array?
Oh yeah, I'm using a function because it was the only way I saw to get the values back to the form, other than public variables.
!! I just has an epiphany... Perhaps I can set the two string values to the forms variables inside the function.. something like
frmPickaFile.strFilePath = strPathfromFunction
I'll go try it out. While I'm doing that, anyone else have a suggestion??
Super thanks
Mike
I'm afraid I know the answer to this already, but...
I have a user form that asks for a file to open. When the user clicks the browse button, a function creates a browse window and allows the user to select a file. The function returns the file name and path to the form (i.e. C:\DooDoo\stinky.dog). When the user clicks the "Open" button this file path is passed along so the program can do all sorts of inappropriate things.
What I was wondering, is it possible to get a function to return multiple values? Ideally, I would have two variables, one for the path (C:\DooDoo) and one for the file name (stinky.dog).
When you tell me that this isn't possible, how then do I split the two? I can't foresee using some string manipulations as the length of the path and file name will vary. Unless I did some sort of backwards string counting that split the string at the backslash before the file name.
Oh bother.
Is it possible to make a function hold an array?
Oh yeah, I'm using a function because it was the only way I saw to get the values back to the form, other than public variables.
!! I just has an epiphany... Perhaps I can set the two string values to the forms variables inside the function.. something like
frmPickaFile.strFilePath = strPathfromFunction
I'll go try it out. While I'm doing that, anyone else have a suggestion??
Super thanks
Mike