Opening Files using Char Expressions. 
Author Message
 Opening Files using Char Expressions.

In Clipper 5.2e I'm experiencing difficulties when
opening an indexed file using a character expression in
parantheses. I'm using the DBFCDX driver.

e.g. extract ...

local cLpath     := "C:\TEST\"
local cFile      := "I1"
local cAlias     := cFile
local cDataf     := cLpath + cFile
local cIndxf     := cDataf
local lret_value := FALSE

   request dbfcdx
   rddsetdefault ( "DBFCDX" )
   .
   .

   lret_value := NetUse ( cDataf, EXCLUSIVE, 5, cAlias)
   index on (cFile)->clientid tag "GENERAL" to (cDataf)
   set index to (CIndxf)

The first trip through the sequence produces no errors.
Doing it a second time (without the 'index on' line)
produces:

DBFCDX\610  'Bad Index Expression!: C:\TEST\I1.DBF"

at the point in NetUse() that simply opens the file. i.e:

   use ( cDataf ) exclusive alias (cAlias) new

Can someone straighten me out?

Alan Secker



Wed, 31 Jul 2002 03:00:00 GMT  
 Opening Files using Char Expressions.
Hi Alan,

Quote:
>    index on (cFile)->clientid tag "GENERAL" to (cDataf)
> ....
> Can someone straighten me out?

Why do you use the (cFile)-> alias ?

It is not neccesary, just try it without !

HTH
Thomas Braun



Wed, 31 Jul 2002 03:00:00 GMT  
 Opening Files using Char Expressions.
Thomas

I t worked! I'm immensely grateful. I still don't understand why it
doesn't work the way I had it. It seems that you can only INDEX ON...
with the relevant database selected. Well, I can live with that. Thanks
again.

Alan Secker

Quote:

> Hi Alan,

> >    index on (cFile)->clientid tag "GENERAL" to (cDataf)
> > ....
> > Can someone straighten me out?

> Why do you use the (cFile)-> alias ?

> It is not neccesary, just try it without !

> HTH
> Thomas Braun



Wed, 31 Jul 2002 03:00:00 GMT  
 Opening Files using Char Expressions.
On Sat, 12 Feb 2000 22:51:05 +0100, Thomas Braun

Quote:

>Hi Alan,

>>    index on (cFile)->clientid tag "GENERAL" to (cDataf)
>> ....
>> Can someone straighten me out?

>Why do you use the (cFile)-> alias ?

>It is not neccesary, just try it without !

>HTH
>Thomas Braun

I think it is neccesary when you compile with /w

     /W
     Generates warning messages for undeclared or unaliased
     (ambiguous) variable references.

Just INDEX ON ITSAFIELD ... will not compile. Because I think the /w
parameter is important (you can't do enough checking) I allways use:
INDEX ON FIELD->ITSAFIELD ...

Jules Alberts



Fri, 02 Aug 2002 03:00:00 GMT  
 Opening Files using Char Expressions.
Jules

Quote:
> Just INDEX ON ITSAFIELD ... will not compile. Because I think the /w
> parameter is important (you can't do enough checking) I allways use:
> INDEX ON FIELD->ITSAFIELD ...

Then put a FIELD statment in the relevant indexing function and you'll be
able to compile<g> with and without /W
eg
FIELD ITSAFIELD
or
FIELD ITSAFIELD         IN <DBFALIAS>

--
HTH
Steve Quinn
Are part-time band leaders semi-conductors?
Do jellyfish get gas from eating jellybeans?
How do you write zero in Roman numerals?
How many weeks are there in a light year?



Sat, 03 Aug 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. VO: Reading Char from open files

2. opening char variable data file

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

4. reversing lines char by char, but not the line order in a file

5. Open VFP 5.0 files using Clipper

6. Open an avi file using ftp

7. How to replace or create a file using the open/create/replace.vi

8. Open a SEQ file using LabVIEW

9. Opening file using PLAIN_TEXT_FILE or RAW_FILE and getting OS error status back

10. Using OS/2 REXX to modify file objects opening menu

11. Using open and then LockFile for a file

12. opening local .wrl files using WorldView

 

 
Powered by phpBB® Forum Software