Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to declare variables 1,2,3,4,5,etc
Message
De
05/06/2003 12:06:08
 
 
À
05/06/2003 03:06:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00796388
Message ID:
00796786
Vues:
15
Guten Morgen Thomas

now i have a question: i didn't realy understand your argument for this (posible) addition to Vfp.
i know that in other languages (c++, perl, etc) you must declare the variable in advance as a certain type and thoughout the life of that var you can assign only that type.

i also understand that it might be faster and easer to write the app because you save 1 line of code for each var.

however, i very much enjoy the fredom to be able to change the type assigned to the var. now, it doesn't happend very much, but in occasions it does. now in other languages if this happens an error is generated in this situation and you are fresh out of luck.

maybe you (and others of course) can elaborate and enlighten me on this?!



>Hi John,
>
>>>VFP has no declare and initialize style command.
>
>>...Yet :-)
>Just speaking theoretically (of course):
>
>In some situations I am currently working on
>it would be especially helpful to be able
>to declare and assign private's, even if it
>is only a technical assign.
>
>I am porting a large app, which has lots of
>redundant code: putting this code into functions
>(just using the privates or passing them by reference)
>requires the privates to be initialized.
>
>A syntax like:
>
>private (pc_SomeStr, pn_num) as integer(1)
>would be nice for this scenario, even better would be something along
>the lines of:
>
>private ;
>(pcStr1, pcStr2) as String(""), ;
>(pnDollar1,pnDebt, pnBalance) as Interger(0), ;
>(plPrinted, plVisible) as Boolean(.f.)
>
>to replace some newly "created" code like
>
>private ;
>pcStr1, pcStr2, ;
>pnDollar1,pnDebt, pnBalance, ;
>plPrinted, plVisible
>
>Store "" To pcStr1, pcStr2
>Store 0 to pnDollar1,pnDebt, pnBalance
>Store .f. to plPrinted, plVisible
>
>This could help porting legacy apps quite a bit, since a rewrite using locals is not possible directly (in my case).
>
>During maintainance some of the privates will be changed into locals, but that will take time...
>
>And those shops that are still working with FPW might consider moving:
>there are quite a few apps here, where total rewriting in VFP is to expensive, but porting might be a smart business decision to lower maintainance cost and get an option to use the goodies of today's VFP.
>
>And they need to order VFP9 for that...
>
>Just my 2 cent (EUR, that is..)
>
>thomas
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform