Serguei, I really don't understand your position. The illustration below is what I would consider to be a classic example of having a single program perform multiple functions according to data passed to it (whether the branch is performed by an IF...ELSE, an ON ... GOSUB or a CASE statement is irrelevant). Yet you've spent the last week or so telling us all that such programs are an abomination.....
I'd agree that contriving to jump into a program designed to do something else and somehow navigate to a particular subroutine just because it happens to be there and can do what you want is very wrong. Equally you are wrong to assert unequivocally that there is NEVER a good reason to have a single program that can perform more than one function depending on data passed to it. At the risk of repeating somebody else's post, I hope your foot heals soon. Regards Piers -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Serguei Sent: 16 February 2006 09:53 To: [email protected] Subject: Re: [U2] [UV] GOSUB variable-name? There is much better OOP-style solution to the file variable problem. Create a named COMMON that is defined in one program only - the program responsible for reading/writing a record of the data. It will open file when it first needed if it is not opened yet and do the writing. And never again anywhere in your programs you will have to write READ RECORD FROM FILE,KEY THEN or READ RECORD TO FILE,KEY THEN Just do: CALL IO.PROGRAM('READ',TABLE.NAME,KEY,RECORD,OK) or CALL IO.PROGRAM('WRITE',TABLE.NAME,KEY,RECORD,OK) ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
