Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Interview question
Message
From
21/05/2012 12:19:56
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01543887
Message ID:
01543943
Views:
55
>>>>>It is not a clean solution.
>>>>>After subprocedure header, and before private variable is declared, public variable is not hidden and it is accessible.
>>>>
>>>>Then put it in the header: name your parameter the same as the public variable. Of course, you will completely confuse yourself and anyone looking at the code, but you won't be able to touch or see PubVar :).
>>>
>>>You are very close. But you use the name of the variable in subroutine header. So, how to do it without even mentioning PubVar in the subroutine?
>>
>>Now I'm very far... even using "local all like *" leaves you open between the header and that line.
>>
>>Fabiooooo! What's he talking about?
>
>Aha, finally I make you cry!

There were no tears in the shed. I was shouting, hoping he may hear. He always has at least two ideas more than I.

>To make a story short.
>I was appointed to take care of a "legacy" application that was distributed and sold to many clients since at least 1994. As usual, no documentation, no database map, and the only programmer who knew the application, he diseased.
>Application is written in the very interesting way. To name a few amazing things: there is no general on error routine, there is no onerror routine that store detailed information, nearly each subroutine has its own on error procedure, basically to prompt client to call the company representative, but mainly to ignore the error and let user to continue. And there are 400+ prg, and 400+ scx,....

To quote an old UT message (which was about hot dog stand color scheme), "you just destroyed $2000 worth of psychotherapy". We have all been there, done that, and then stopped washing our cars, because we'd have to use the T-shirt and it would bring memories.

>Regarding what I call "interview question".
>Sure enough, it is not the first time I laugh and ask myself, what is going on, why on earth it was implemented this way, etc.
>In the main program public variable are declared. And then there are a huge number of the subsequent chain procedure calls.
>Somewhere public variable disappears (sure, the error is ignored). It appeared that this subroutine is the 16th in the chain.
>And how it disappeared, if it was not mentioned anywhere in the chain since # 9 in this chain?
>Because #10 was called with parameters like:
>
>Do subrotuine_10 with PubVar

Ouch... I spent half an hour fighting that one, when I did that myself (accidentally), back in mFoxPlus... that day I learned all I needed to know about public and private variables and how does fox do that. I didn't cause any traffic accidents on my way home.

>Start your Monday laughing.

Luckily, it's past 18:00 here, I'm done for today. But my head is still spinning when I remember doing "list memory" for the nth time and not being able to understand what it says... and why is the public instance of the variable (which was, to make things worse, named exactly the same as the parameter) prefixed with a @...

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform