Re: Question about select/use and alias
- From: Scott Coffey <none@xxxxxxxxxxx>
- Date: Wed, 06 Jul 2005 10:47:57 -0400
On Wed, 6 Jul 2005 06:42:44 +0200, "AUGE_OHR"
<AUGE_OHR_NOSPAM_@xxxxxxx> wrote:
>hi,
>
>> called program "B" which re-opened one of the files without using an
>
>there is no need to open a DBF "again" if it is still open
Good. I can clean up quite a bit of redundant code.
>> Program "A"
>> select 1
>> use SETUP.DBF alias STP
>> do Program "B"
>> select STP <---- fails with type mismatch
>>
>> Program "B"
>> select 1
>> use SETUP.DBF <---- note that no alias was used
>
>calling USE without "alias" will use DBF Name as ALIAS()
>
>> I'm a bit confused about scoping. If program "A" opens a file and
>> then calls program "B", does program "B" have to open the file again?
>
>NO, if it is open. try something like
>
>> Program "B"
>> select 1
>IF ALIAS() = "STP"
> * it is open and can be used
>ELSE
OK. Is there a limitation on how many files can be open at once?
(Summer '87).
>> use SETUP.DBF <---- note that no alias was used
>
>if you use a "alias" different than the DBF Name, you have to use the
>"alias"
>every time the same way
>
> use SETUP.DBF alias STP
>
>ENDIF
>
>> code. If program "B" doesn't need to open the file, then do you need
>> to prefix any field names used by that file with the file alias? I
>
>if you have "select" right "workarea" you do not need any prefix like
>"STP->"
>but you can do it to make it more "readable"
>
>> would estimate that only about a fourth of the code I'm seeing has the
>> alias prefix in front of a database field. So I'm as likely to see
>> ORD->TOTAMT as I am just TOTAMT.
>
>if you use a prefix like "ORD->" you must not have "select workarea" before
>to get/store "ORD->fieldname"
I want to make sure I'm understanding this correctly. If I open a
file *once* in a program, then as long as I use the alias prefix in
front of a field name (or if the field name is unique) then I don't
ever have to "select workarea" again.... correct?
>... and did you think of network ?
>make a "NetUSE" function and include "workarea","alias" and "set index to".
>this will help to enhance index order/tag
No network, so not an issue.
Thanks for the reply Jimmy.
Scott
.
- Follow-Ups:
- Re: Question about select/use and alias
- From: pete
- Re: Question about select/use and alias
- References:
- Question about select/use and alias
- From: Scott Coffey
- Re: Question about select/use and alias
- From: pete
- Re: Question about select/use and alias
- From: Scott Coffey
- Question about select/use and alias
- Prev by Date: caci.ini
- Next by Date: Re: Question about select/use and alias
- Previous by thread: Re: Question about select/use and alias
- Next by thread: Re: Question about select/use and alias
- Index(es):
Relevant Pages
|