Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing numeric variable by reference
Message
From
21/06/2007 14:07:05
 
 
To
21/06/2007 13:47:11
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP
Miscellaneous
Thread ID:
01234773
Message ID:
01234820
Views:
12
The documention is not real clear on this. Here is intellisense in VFP for 2 functions:
dsOpen(FileName as String, Channel as Number @) as Number
dsReadRec(Channel as Number, Key as String, KeyNumber as Number, Record as String @) as Number
You can see that the second function does not want it by reference...because you need to know the channel to make the call. In dsReadRec(), the record is returned by reference in the last parameter.

It seems to keep the channel that I assign to a file. However, if I connect to the server and try to open a file and give it channel 4 (or higher) without opening files first, it does not open that file under channel 4.
ods.dsConnect("192.168.1.99",8227,40000)
? ods.dsOpen("g:\ssi605\data\ic\iclots", 4)
lcKey = ''
? ods.dsGetKeyFirst(4, @lcKey)   && shows error 13, impoper file access...file 4 is not open
? ods.dsGetKeyFirst(1, @lcKey)   && shows -1, success
? lcKey    && shows the key for the first record in iclots
In this example, the file was opened under channel 1, and if I could get the 2nd parameter by reference, everything would be peachy.


>
>I don't see anywhere in documentation where that COM could change channel.
>It expects dsOpen(fl$,chan%)
>
>• $ for strings
>• & for long integers
>• % for short integers
>
>Not passed by reference at all, so it couldn't change the channel at all.
>Of course I could be wrong, but from documentation:
>
>Either way, you are provided a file channel that is used to read data in the file.
Steve Gibson
Previous
Reply
Map
View

Click here to load this message in the networking platform