Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
May I return an array in calling procedure from Form.Unl
Message
 
 
À
09/01/2000 12:56:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00315113
Message ID:
00315196
Vues:
31
Ed,

Thanks a lot for this reply and clarification.

>>
>>I'm just thinking, is it possible to return an array into top-level procedure from the form? What are the possible scenarios?
>>
>>Say, External array in form.Init method as a parameter?
>>Or declare this array in calling procedure and return in Form.Unload?
>>
>>Or we can not return an array?
>
>A modal form can return a simple variable; arrays don't qualify. You can pass in an array by reference and modify it; the results would be visible on exit, but nothing would be explicitly returned.
>
>By far the best approach to the problem would be to pass back an object that contained a member array; you can return an object (it's a single item) and then examine the content. You can use this technique any time you need to pass back arrays or multiple values.

Let's me explain, why I asked my question. Recently we found, that several of our apps, which were written by the same programmer, don't close DS after theirselves, even if they use Private DS. I asked this question here and also my collegue directly, and we found, that ErrorHandler object causes this behavior.

So, now we should find a way, how to prevent this behavior, if we don't want to leave DS open.

We consider three scenarios here:
1) Declare several private variables in the main program, instanciate ErrorHandler object for each of the app, which using it, (by using NewObject()).
This approach has several obvious disadvantages.

2)Declare only one ErrorHandler for whole system by one common name. Again, disadvantages are obvious.

3) My idea - each form allocates ErrorHandler by itself and release this object in Form release or destroy method. From my point of view, that this is the best solution, but in this case we can not pass information back into calling procedure, right? Advantage of my idea is that we can create multiple instances of this form.

What is your opinion?
TIA
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform