Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: in USE the ALIAS clause does not support a procedur
Message
De
24/04/2004 07:48:46
 
 
À
24/04/2004 06:50:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00897871
Message ID:
00897877
Vues:
13
>This bug is a parser bug, and it is the same of the bug into the TYPE() command;
>the parser search for a array.
>
>This occur for Procedure and Methods.
>
>Repro:
>
>CREATE CURSOR myCursor ( myField I)
>USE DBF() IN 0 ALIAS (myProc(1)) AGAIN && <== ERROR
>USE
>
>PROCEDURE myProc
>  RETURN 'myAlias'
>ENDPROC
>
hi Fabio,

The problem is that you can use ( or [ for both arrays and functions.
Then the only thing that is known after parsing is that it must find an array or a function.
I would prefer function() and array[]
aa='123'
?type[[aa]]
?type['aa']
?type('aa')
?type[[aa]    && error : 'Function name is missing )'  (not ])
If the function is an internal function, it knows it is a function.
If not, it assumes an array in your example
this works
CREATE CURSOR myCursor ( myField I)
use DBF('myCursor') again in 0 alias (juststem(dbf('myCursor'))+'_')
In the context below, it also tests for an array. If the array exists, it is used
If the array does not exist a function call is attempted
public myProc[2]
myProc[1] = 'array'

?MyProc[1] && array

release MyProc

?MyProc[1] && function

?MyProc2(1)  && error : file MyProc2.prg does not exist

function Myproc(xx)
    return 'function'
endfunc
In a nutshell
do case
case internal function
    use it

case array defined
   use it

case ??? (for some commands)
   throw an error

case function defined
   use it

otherwise
   throw an error

endcase
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform