How to open a file with a variable filename 
Author Message
 How to open a file with a variable filename

I can't find out how to open a Clarion data file (Variable_Name.TPS).
I am using DosFileLookUp, and storing the filename in a Global variable.
But how can I open the file file when I have chosen the one I want to open?
The problem is that the program tries to open a variable instead of the
content of the variable.
Any help with the syntax appreciated.

William



Sun, 07 Apr 2002 03:00:00 GMT  
 How to open a file with a variable filename
Set this as your filename in the dictionary
    !glo:customer
where glo:customer is a global variable in the app.
Assign the name of the variable and open the file. if you want to open a
different file don't forget to close the first under it's name!

--
Best Regards
James Cooke
Certified Clarion Developer



Sun, 07 Apr 2002 03:00:00 GMT  
 How to open a file with a variable filename
Hi James

I'm sorry, but I can't see what you mean!
Could you please give another explanation...

The problem is:

We've got this global variable Glo:Filename and it contains the full path to
the file that we want to open using this command "access:GLO:Filename.Open"
but it won't work. Can you please give us some great ideas...

William

PS. There could be a problem using this command, so if you've got other
solutions, they're always welcome.

Quote:

>Set this as your filename in the dictionary
>    !glo:customer
>where glo:customer is a global variable in the app.
>Assign the name of the variable and open the file. if you want to open a
>different file don't forget to close the first under it's name!

>--
>Best Regards
>James Cooke
>Certified Clarion Developer



Sun, 07 Apr 2002 03:00:00 GMT  
 How to open a file with a variable filename
Your syntax is screwed up.

In your data dictionary define a file (I.E.    InternationalCustomers)
In the FULL PATH NAME field on the PROPERTIES window for the file put
!GLO:Customer (as James Cooke suggests).

Now,  in your application declare a variable that is GLO:Customer.  This is a
string 255 characters long (just to be safe in case you have a long name).

What you need to do now is assign a value to GLO:Customer before the program
tries to open the file so that it knows what file to open (it will crash if it
tries to open a file without a name).

Before the file is opened, use your file dialog and select a file name and put
it into GLO:Customer

The file syntax to open your file with the variable name is
   ACCESS.InternationalCustomers.Open

   You need the dictionary's name of the file (InternationalCustomers) not the
actual dos file name in the command Access..Open.

        Tim

Quote:

> Hi James

> I'm sorry, but I can't see what you mean!
> Could you please give another explanation...

> The problem is:

> We've got this global variable Glo:Filename and it contains the full path to
> the file that we want to open using this command "access:GLO:Filename.Open"
> but it won't work. Can you please give us some great ideas...

> William

> PS. There could be a problem using this command, so if you've got other
> solutions, they're always welcome.


> >Set this as your filename in the dictionary
> >    !glo:customer
> >where glo:customer is a global variable in the app.
> >Assign the name of the variable and open the file. if you want to open a
> >different file don't forget to close the first under it's name!

> >--
> >Best Regards
> >James Cooke
> >Certified Clarion Developer

--
Tim Phillips
Vermont Agency of Natural Resources
Department of Environmental Conservation


Sun, 07 Apr 2002 03:00:00 GMT  
 How to open a file with a variable filename
William,

You would define Myfile (in the dictionary) with !GLO:Filename as the
Full Pathname so that the templates will generate the file declaration
using a NAME of GLO:FileName.  At runtime prior to opening Myfile, you'd
need to make certain that GLO:Filename contained a value which was the
name of the file to be opened.  

Something like:

Myfile FILE,DRIVER(...),NAME(GLO:Filename),blah,blah,blah.  ! Gen'd by
templates

  CODE

! Assign the name of the file to the variable
  GLO:Filename = 'C:\WHATEVER\YOUWANT.TPS'
! Open the file
  Access:Myfile.Open

HTH

Al



Sun, 07 Apr 2002 03:00:00 GMT  
 How to open a file with a variable filename
Greetings William,

What I think you're missing is the exclamation mark ! at the
beginning of the file name in the data dictionary to indicate
a variable.  Try !GLO:Variable_Name instead of GLO:Variable_Name
and see if that solves your problem.

HTH
Mark Kroflich
mark(a)lists-inc.com

Quote:

> I can't find out how to open a Clarion data file (Variable_Name.TPS).
> I am using DosFileLookUp, and storing the filename in a Global
> variable.  But how can I open the file file when I have chosen the
> one I want to open?
> The problem is that the program tries to open a variable instead of
> the content of the variable.
> Any help with the syntax appreciated.

> William



Sun, 07 Apr 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. How to Specify Variable FileName(!FileName)In Report

2. Using variable filename(!FILENAME)

3. filename corruption while opening dbf file

4. Opening a file on NT with a space in the filename

5. read filename and then open text file

6. opening file with prompt for filename - please help

7. FileName as Runtime Variable not working for .tps files

8. error 37 File not open using a variable file name

9. How to open file with variable

10. Trouble with reference variable to open a file

11. File not open (37) and No Bind on variable (801)errors

12. Variable parameter for OPEN(file)

 

 
Powered by phpBB® Forum Software