Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling a function from itself
Message
De
03/04/2006 07:50:41
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
31/03/2006 13:40:42
Jim Winter
Jim Winter Consulting
Hinesburg, Vermont, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01109601
Message ID:
01109900
Vues:
17
>>Here is my code:
>>FUNCTION GenerateLawLabelBarcode
>>LPARAMETERS ...
>> .......
>> GenerateLawLabelBarcode(....)
>> return ....
>>ENDFUNC
>>
>>I have an error saying that a file "GenerateLawLabelBarcode" does not exist.
>>
>>Please, help.
>
>You can't do that! A function or procedure can't call itself.
>
>If you want to have it called repeatedly, you need to set up some sort of loop outside the function that calls it.
>
>Regards,

Jim,
As many already said you can do that, however you're right to a point, should you do that:) I tend not to create recursive functions if I can create one that's not recursive (and almost all the time I find a non-recursive one). IMHO recursive code is easier to write but is evil. With recursion you should be very carefull not to overflow stack space and/or nesting levels.
PS: Maybe a perception but looks like generally non-recursive code is faster.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform