Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing numeric variable by reference
Message
De
21/06/2007 14:07:05
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows XP
Divers
Thread ID:
01234773
Message ID:
01234820
Vues:
10
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform