Re: Question about select/use and alias



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

.



Relevant Pages

  • Re: Strange Undefined Identifier
    ... single program statement... ... The other folder has the same DBF name that you have opened under ... The program and DBF files and field structure by all appearances are ... have made is to use a name as an alias, instead of C->TX_DTE, I now have ...
    (comp.lang.clipper)
  • Re: DBFUSED() in VFP6 or later?
    ... What you do get is a list of the alias' that are used. ... matter to do a DBF() on the array element to get the fullpath of the .DBF or ... "Zeke Galama" wrote in message ... >>> local lOpen as boolean, i as integer, cAlias as String ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Find Resulting ALIAS() after SELECT
    ... the functions ALIAS() and DBFwill tell where the query result is. ... INTO TABLE is not supposed to produce a TMP file but a DBF file. ... How can I find out what ALIAS ...
    (microsoft.public.fox.programmer.exchange)
  • Re: File is in use
    ... > Any chance you're copying to an unexpected directory ... and that DBF maybe open with a different ... Ni Xau, you can use DBFto get the ... area or alias. ...
    (microsoft.public.fox.helpwanted)
  • Re: Alias in different subnet on card
    ... Alias in different subnet on card ... > I'm running a firewall at the moment using FreeBSD 5.2.1 and IPFW. ... > this by adding an alias to xl1, ... > have to get another network card? ...
    (freebsd-questions)