Re: [U2] Multiple OPEN statements

2005-04-16 Thread Mark Johnson
How early Microdata. I have one client with November 1975 written source
code and it's the traditional
OPEN FILE1 TO F.FILE1 ELSE PRINT ELONGATED VERBOSE ERRORMESSAGE
OPEN FILE2 TO F.FILE2 ELSE PRINT ELONGATED VERBOSE ERRORMESSAGE
for their core programs, opening dozens of files.

Thanks.

- Original Message -
From: Roger Glenfield [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Friday, April 15, 2005 10:29 PM
Subject: Re: [U2] Multiple OPEN statements


 Probably a left over.  Way back in early Microdata.  You could only open
 one file at a time.  There was no TO clause.  You had the file opened.
 If you wanted to access another file, you had to close the current one
 and open the next.

 Kevin used Dartmouth as his base, so think pre-Micro$oft.

 Roger
 Mark Johnson wrote:

 Is this CLOSE thing a new thing. Haven't seen or heard of it in a quarter
of
 a century. I know it's in MS Basic(s).
 - Original Message -
 From: Don Kibbey [EMAIL PROTECTED]
 To: u2-users@listserver.u2ug.org
 Sent: Friday, April 15, 2005 7:22 AM
 Subject: Re: [U2] Multiple OPEN statements
 
 
 
 
 That programmer was probably squaked at for not closing a file or two.
  Then he/she found a way to insure that would be caught next time by
 the compiler.
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
 
 
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Multiple OPEN statements

2005-04-16 Thread Roger Glenfield
Can't say for sure.  I remember seeing it in one of the old programs 
that I had to work on in 1976/77.

So I'm guessing very early Basic.  After all, as we all know.  Kevin 
only wanted to get a football program running.  So he probably didn't 
worry that much about data files.

Roger
Mark Johnson wrote:
How early Microdata. I have one client with November 1975 written source
code and it's the traditional
OPEN FILE1 TO F.FILE1 ELSE PRINT ELONGATED VERBOSE ERRORMESSAGE
OPEN FILE2 TO F.FILE2 ELSE PRINT ELONGATED VERBOSE ERRORMESSAGE
for their core programs, opening dozens of files.
Thanks.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Multiple OPEN statements

2005-04-16 Thread Allen Bell
Who's Kevin?
Do you mean Ken Simms?

Roger Glenfield wrote:
Can't say for sure.  I remember seeing it in one of the old programs 
that I had to work on in 1976/77.

So I'm guessing very early Basic.  After all, as we all know.  Kevin 
only wanted to get a football program running.  So he probably didn't 
worry that much about data files.

Roger
Mark Johnson wrote:
How early Microdata. I have one client with November 1975 written source
code and it's the traditional
OPEN FILE1 TO F.FILE1 ELSE PRINT ELONGATED VERBOSE ERRORMESSAGE
OPEN FILE2 TO F.FILE2 ELSE PRINT ELONGATED VERBOSE ERRORMESSAGE
for their core programs, opening dozens of files.
Thanks.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Multiple OPEN statements

2005-04-16 Thread Bill H.
Mark:

I would say this is legitimate if one is reading from, or opening, a
prioritized list of files.  For instance, say I want to get a configuration
parameter and want to:

READ ParameterValue FROM ParameterFile.Fv, ParameterId THEN...ELSE...

This parameter can come from any of several files already prioritized, say:

LOCAL_PARAMETERS
GLOBAL_PARAMETERS

Then one might:

OPEN 'LOCAL_PARAMETERS' TO ParameterFile.Fv ELSE
   OPEN 'GLOBAL_PARAMETERS' TO ParameterFile.Fv THEN...ELSE...
END

Just a thought.  :-)

Bill

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Mark Johnson
 Sent: Friday, April 15, 2005 7:00 PM
 To: u2-users@listserver.u2ug.org
 Subject: Re: [U2] Multiple OPEN statements
 
 Call me old-school but I prefer top-down OPEN file TO handle 
 ELSE STOP (sic) to get them all out of the way. Whether 1 or 
 50 files, the get all opened at the same time. If those 
 choose to have a CALL OPEN.FILES internal sub or named 
 commons, then that's also a respectable method.
 
 To have the main portion of the code be that indented only 
 makes maintenance later that much more difficult. Very, very 
 few people seem to label their END statements to indicate 
 what they're matched to.
 
 Upon further investigation (using that programmers initials) 
 i found that when there were 8 or more file, he did it in a 
 more top-down or sequential fashion. That introduces 2 forms 
 of coding for the same concept which is 1 form too many.
 
 That programmer is still at this client and uses the tired 
 response That's what I was taught when shown how hard it is 
 to follow all of those indents.
 Can't teach an old dog...
 
 my 1 cent
 - Original Message -
 From: Jerry Banker [EMAIL PROTECTED]
 To: u2-users@listserver.u2ug.org
 Sent: Friday, April 15, 2005 10:36 AM
 Subject: Re: [U2] Multiple OPEN statements
 
 
  - Original Message -
   From: Don Kibbey [EMAIL PROTECTED] You did mention 
 only a few 
   files display this type of syntax.  Perhaps said programmer was 
   shown the door
 
  I don't see why you would think that and frankly I'm surprised you 
  haven't come across this style of programming before. This style of 
  programming
 was
  taught in classrooms all over the country before the advent 
 of point 
  and click programming. It is a structured way of 
 programming based on 
  a logic
  sequence:
  What is the first file I need?
  OPEN FILE1 TO F.FILE1 THEN
  END ELSE PRINT CAN'T OPEN FILE1
  END
 
  Do I need another one?
  OPEN FILE1 TO F.FILE1 THEN
   OPEN FILE2 TO F.FILE2 THEN
   END ELSE PRINT CAN'T OPEN FILE2
  END ELSE PRINT CAN'T OPEN FILE1
  END
 
  And another?
  OPEN FILE1 TO F.FILE1 THEN
   OPEN FILE2 TO F.FILE2 THEN
   OPEN FILE3 TO F.FILE3 THEN
   END ELSE PRINT CAN'T OPEN FILE3
   END ELSE PRINT CAN'T OPEN FILE2
  END ELSE PRINT CAN'T OPEN FILE1
  END
 
  Now that I've got these open what do I do with them OPEN FILE1 TO 
  F.FILE1 THEN
   OPEN FILE2 TO F.FILE2 THEN
   OPEN FILE3 TO F.FILE3 THEN
   EOF=0
   LOOP READNEXT ID ELSE EOF=1 UNTIL EOF DO
   PROCESS, PROCESS, PROCESS
   REPEAT
   END ELSE PRINT CAN'T OPEN FILE3
   END ELSE PRINT CAN'T OPEN FILE2
  END ELSE PRINT CAN'T OPEN FILE1
  END
 
  Although when the gosub came out most programmers took the 
 center out 
  and put it into a separate subroutine.
  ---
  u2-users mailing list
  u2-users@listserver.u2ug.org
  To unsubscribe please visit http://listserver.u2ug.org/
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Multiple OPEN statements

2005-04-16 Thread Roger Glenfield
Senioritis has set in.  Yes Ken Simms.
Allen Bell wrote:
Who's Kevin?
Do you mean Ken Simms?
Roger Glenfield wrote:

Can't say for sure.  I remember seeing it in one of the old programs 
that I had to work on in 1976/77.

So I'm guessing very early Basic.  After all, as we all know.  Kevin 
only wanted to get a football program running.  So he probably didn't 
worry that much about data files.

Roger
Mark Johnson wrote:
How early Microdata. I have one client with November 1975 written 
source
code and it's the traditional
OPEN FILE1 TO F.FILE1 ELSE PRINT ELONGATED VERBOSE ERRORMESSAGE
OPEN FILE2 TO F.FILE2 ELSE PRINT ELONGATED VERBOSE ERRORMESSAGE
for their core programs, opening dozens of files.

Thanks.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Multiple OPEN statements

2005-04-16 Thread Mark Johnson
This is not the first time people have referenced 'classrooms' where
programming was learned. Any specific classrooms where Pick/MV was taught
besides the VAR's seminars. Specifically a formal accredited environment for
Pick/MV and not just some left-over Pascal-era or contemporary teachings.

I would like to learn of these places that propogated some of the techniques
many endorse that may or not be embraced by others.

Thanks.

- Original Message -
From: Jerry Banker [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Friday, April 15, 2005 10:36 AM
Subject: Re: [U2] Multiple OPEN statements


 - Original Message -
  From: Don Kibbey [EMAIL PROTECTED]
  You did mention only a few files display this type of syntax.  Perhaps
  said programmer was shown the door

 I don't see why you would think that and frankly I'm surprised you haven't
 come across this style of programming before. This style of programming
was
 taught in classrooms all over the country before the advent of point and
 click programming. It is a structured way of programming based on a logic
 sequence:
 What is the first file I need?
 OPEN FILE1 TO F.FILE1 THEN
 END ELSE PRINT CAN'T OPEN FILE1
 END

 Do I need another one?
 OPEN FILE1 TO F.FILE1 THEN
  OPEN FILE2 TO F.FILE2 THEN
  END ELSE PRINT CAN'T OPEN FILE2
 END ELSE PRINT CAN'T OPEN FILE1
 END

 And another?
 OPEN FILE1 TO F.FILE1 THEN
  OPEN FILE2 TO F.FILE2 THEN
  OPEN FILE3 TO F.FILE3 THEN
  END ELSE PRINT CAN'T OPEN FILE3
  END ELSE PRINT CAN'T OPEN FILE2
 END ELSE PRINT CAN'T OPEN FILE1
 END

 Now that I've got these open what do I do with them
 OPEN FILE1 TO F.FILE1 THEN
  OPEN FILE2 TO F.FILE2 THEN
  OPEN FILE3 TO F.FILE3 THEN
  EOF=0
  LOOP READNEXT ID ELSE EOF=1 UNTIL EOF DO
  PROCESS, PROCESS, PROCESS
  REPEAT
  END ELSE PRINT CAN'T OPEN FILE3
  END ELSE PRINT CAN'T OPEN FILE2
 END ELSE PRINT CAN'T OPEN FILE1
 END

 Although when the gosub came out most programmers took the center out and
 put it into a separate subroutine.
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Multiple OPEN statements

2005-04-16 Thread Mark Johnson
That school is very diverse and doesn't offer any standardization that seems
to come up every once in a while on this forum. I appreciate the humor but
I'm really trying to learn where people are taught their Pick/MV techniques
(and defend them as gospel as they have been taught) as opposed to extending
one language's disciplines to another, namely Pick/MV.

Thanks
- Original Message -
From: Bruce Nichol [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Saturday, April 16, 2005 5:35 PM
Subject: Re: [U2] Multiple OPEN statements


 Goo'day,

 At 15:12 16/04/05 -0400, you wrote:

 This is not the first time people have referenced 'classrooms' where
 programming was learned. Any specific classrooms where Pick/MV was taught
 besides the VAR's seminars. Specifically a formal accredited environment
for
 Pick/MV and not just some left-over Pascal-era or contemporary teachings.
 
 I would like to learn of these places that propogated some of the
techniques
 many endorse that may or not be embraced by others.

 School of Hard Knocks?? There's a lot of the alumni out there.

 Thanks.
 
 - Original Message -
 From: Jerry Banker [EMAIL PROTECTED]
 To: u2-users@listserver.u2ug.org
 Sent: Friday, April 15, 2005 10:36 AM
 Subject: Re: [U2] Multiple OPEN statements
 
 
   - Original Message -
From: Don Kibbey [EMAIL PROTECTED]
You did mention only a few files display this type of syntax.
Perhaps
said programmer was shown the door
  
   I don't see why you would think that and frankly I'm surprised you
haven't
   come across this style of programming before. This style of
programming
 was
   taught in classrooms all over the country before the advent of point
and
   click programming. It is a structured way of programming based on a
logic
   sequence:
   What is the first file I need?
   OPEN FILE1 TO F.FILE1 THEN
   END ELSE PRINT CAN'T OPEN FILE1
   END
  
   Do I need another one?
   OPEN FILE1 TO F.FILE1 THEN
OPEN FILE2 TO F.FILE2 THEN
END ELSE PRINT CAN'T OPEN FILE2
   END ELSE PRINT CAN'T OPEN FILE1
   END
  
   And another?
   OPEN FILE1 TO F.FILE1 THEN
OPEN FILE2 TO F.FILE2 THEN
OPEN FILE3 TO F.FILE3 THEN
END ELSE PRINT CAN'T OPEN FILE3
END ELSE PRINT CAN'T OPEN FILE2
   END ELSE PRINT CAN'T OPEN FILE1
   END
  
   Now that I've got these open what do I do with them
   OPEN FILE1 TO F.FILE1 THEN
OPEN FILE2 TO F.FILE2 THEN
OPEN FILE3 TO F.FILE3 THEN
EOF=0
LOOP READNEXT ID ELSE EOF=1 UNTIL EOF DO
PROCESS, PROCESS, PROCESS
REPEAT
END ELSE PRINT CAN'T OPEN FILE3
END ELSE PRINT CAN'T OPEN FILE2
   END ELSE PRINT CAN'T OPEN FILE1
   END
  
   Although when the gosub came out most programmers took the center out
and
   put it into a separate subroutine.
   ---
   u2-users mailing list
   u2-users@listserver.u2ug.org
   To unsubscribe please visit http://listserver.u2ug.org/
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
 
 
 --
 No virus found in this incoming message.
 Checked by AVG Anti-Virus.
 Version: 7.0.308 / Virus Database: 266.9.13 - Release Date: 16/04/05
 
 
 
 
 --
 No virus found in this incoming message.
 Checked by AVG Anti-Virus.
 Version: 7.0.308 / Virus Database: 266.9.13 - Release Date: 16/04/05

 Regards,

 Bruce Nichol
 Talon Computer Services
 ALBURYNSW 2640
 Australia

 http://www.taloncs.com.au

 Tel: +61 (0)411149636
 Fax: +61 (0)260232119

 If it ain't broke, fix it till it is!


 --
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.308 / Virus Database: 266.9.13 - Release Date: 16/04/05




 --
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.308 / Virus Database: 266.9.13 - Release Date: 16/04/05
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Multiple OPEN statements

2005-04-16 Thread Mark Johnson
Play on words, eh? There's just no official standards despite what many
imply.

- Original Message -
From: [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Saturday, April 16, 2005 8:19 PM
Subject: Re: [U2] Multiple OPEN statements


 Are you implying it would be better if programmers had no class ?
 Will

 In a message dated 4/16/2005 12:23:22 PM Pacific Daylight Time,
 [EMAIL PROTECTED] writes:


 
  This is not the first time people have referenced 'classrooms' where
  programming was learned. Any specific classrooms where Pick/MV was
taught
  besides the VAR's seminars. Specifically a formal accredited environment
for
  Pick/MV and not just some left-over Pascal-era or contemporary
teachings.
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Multiple OPEN statements

2005-04-15 Thread Mark Johnson
Can't this whole concept be considered foolish as if there were 20-30 files
(as many update programs have) then the programmer would have to use a
different mental syntax. That would imply that the real code starts around
column 140.
- Original Message -
From: Ken Wallis [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Thursday, April 14, 2005 11:51 PM
Subject: RE: [U2] Multiple OPEN statements


 Mark Johnson wrote:

  I just acquired a new client and found an interesting
  programming style that
  for the life of me I cannot understand why anyone in their
  right mind would do such a thing.
 
  Not on all programs but it seems that for programs that open
  less than 4-5
  files, the programmer continues the logic in the THEN section
  of the open statement. Example:
 
  OPEN FILE1 TO F.FILE1 THEN
  OPEN FILE2 TO F.FILE2 THEN
  OPEN FILE3 TO F.FILE3 THEN
  EOF=0
  LOOP READNEXT ID ELSE EOF=1 UNTIL EOF DO
  PROCESS, PROCESS, PROCESS
  REPEAT
  END ELSE PRINT CAN'T OPEN FILE3
  END ELSE PRINT CAN'T OPEN FILE2
  END ELSE PRINT CAN'T OPEN FILE1
  END

 Yes Mark, this is a new fangled thing that I believe is called 'Structured
 Programming'.  I suspect it'll never catch on, obviously it's only just
 reaching your part of the world. ;^)

  There could be 200-300 lines between the OPEN for FILE3 and
  its error message.

 Well, that part I don't like, but shit happens I suppose.  A bit like:

 OPEN FILE1 TO F.FILE1 ELSE GOTO 999

 where 999 is a long way away.

 Personally, I'd code the above example as:

 OPEN FILE1 TO F.FILE1 THEN
 OPEN FILE2 TO F.FILE2 THEN
 OPEN FILE3 TO F.FILE3 THEN
 GOSUB PROCESS_STUFF
 END ELSE PRINT CAN'T OPEN FILE3
 END ELSE PRINT CAN'T OPEN FILE2
 END ELSE PRINT CAN'T OPEN FILE1

 STOP

 PROCESS_STUFF:
 EOF=0
 LOOP READNEXT ID ELSE EOF=1 UNTIL EOF DO
 PROCESS, PROCESS, PROCESS
 REPEAT
 RETURN

 END

 or even as:

 GOSUB OPEN_FILES
 IF SHIT_HAPPENED ELSE
 GOSUB PROCESS_STUFF
 END
 STOP

 OPEN_FILES:
 SHIT_HAPPENED = 
 OPEN FILE1 TO F.FILE1 THEN
 OPEN FILE2 TO F.FILE2 THEN
 OPEN FILE3 TO F.FILE3 ELSE
 SHIT_HAPPENED = FILE3
 END
 END ELSE
 SHIT_HAPPENED = FILE2
 END
 END ELSE
 SHIT_HAPPENED = FILE1
 END
 IF SHIT_HAPPENED THEN
 PRINT Can't open :SHIT_HAPPENED
 END
 RETURN

 PROCESS_STUFF:
 EOF=0
 LOOP READNEXT ID ELSE EOF=1 UNTIL EOF DO
 PROCESS, PROCESS, PROCESS
 REPEAT
 RETURN
 END

  Now I know that Pick is pretty loose and forgiving. But what
  could be the sanity behind this.

 You know the funny thing is that programmers who use decent editors don't
 seem
 to find the whole indentation thing so challenging. ;^)

 Cheers,

 Ken
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Multiple OPEN statements

2005-04-15 Thread Mark Johnson
Is this CLOSE thing a new thing. Haven't seen or heard of it in a quarter of
a century. I know it's in MS Basic(s).
- Original Message -
From: Don Kibbey [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Friday, April 15, 2005 7:22 AM
Subject: Re: [U2] Multiple OPEN statements


 That programmer was probably squaked at for not closing a file or two.
  Then he/she found a way to insure that would be caught next time by
 the compiler.
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Multiple OPEN statements

2005-04-15 Thread Mark Johnson
Call me old-school but I prefer top-down OPEN file TO handle ELSE STOP (sic)
to get them all out of the way. Whether 1 or 50 files, the get all opened at
the same time. If those choose to have a CALL OPEN.FILES internal sub or
named commons, then that's also a respectable method.

To have the main portion of the code be that indented only makes maintenance
later that much more difficult. Very, very few people seem to label their
END statements to indicate what they're matched to.

Upon further investigation (using that programmers initials) i found that
when there were 8 or more file, he did it in a more top-down or sequential
fashion. That introduces 2 forms of coding for the same concept which is 1
form too many.

That programmer is still at this client and uses the tired response That's
what I was taught when shown how hard it is to follow all of those indents.
Can't teach an old dog...

my 1 cent
- Original Message -
From: Jerry Banker [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Friday, April 15, 2005 10:36 AM
Subject: Re: [U2] Multiple OPEN statements


 - Original Message -
  From: Don Kibbey [EMAIL PROTECTED]
  You did mention only a few files display this type of syntax.  Perhaps
  said programmer was shown the door

 I don't see why you would think that and frankly I'm surprised you haven't
 come across this style of programming before. This style of programming
was
 taught in classrooms all over the country before the advent of point and
 click programming. It is a structured way of programming based on a logic
 sequence:
 What is the first file I need?
 OPEN FILE1 TO F.FILE1 THEN
 END ELSE PRINT CAN'T OPEN FILE1
 END

 Do I need another one?
 OPEN FILE1 TO F.FILE1 THEN
  OPEN FILE2 TO F.FILE2 THEN
  END ELSE PRINT CAN'T OPEN FILE2
 END ELSE PRINT CAN'T OPEN FILE1
 END

 And another?
 OPEN FILE1 TO F.FILE1 THEN
  OPEN FILE2 TO F.FILE2 THEN
  OPEN FILE3 TO F.FILE3 THEN
  END ELSE PRINT CAN'T OPEN FILE3
  END ELSE PRINT CAN'T OPEN FILE2
 END ELSE PRINT CAN'T OPEN FILE1
 END

 Now that I've got these open what do I do with them
 OPEN FILE1 TO F.FILE1 THEN
  OPEN FILE2 TO F.FILE2 THEN
  OPEN FILE3 TO F.FILE3 THEN
  EOF=0
  LOOP READNEXT ID ELSE EOF=1 UNTIL EOF DO
  PROCESS, PROCESS, PROCESS
  REPEAT
  END ELSE PRINT CAN'T OPEN FILE3
  END ELSE PRINT CAN'T OPEN FILE2
 END ELSE PRINT CAN'T OPEN FILE1
 END

 Although when the gosub came out most programmers took the center out and
 put it into a separate subroutine.
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Multiple OPEN statements

2005-04-15 Thread Derek Falkner
The CLOSE command has been used in UV and, if you're using UV/NET to access
a file, you must close that file. Failure to do so will cause UV/NET to die
when its file pool reaches its limit. I suspect not many sites ever used
UV/NET so it's probably a rare piece of trivia and I offer it for what it's
worth.

Derek Falkner
Kingston, Ontario, Canada

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Johnson
Sent: Friday, April 15, 2005 8:29 AM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Multiple OPEN statements


Is this CLOSE thing a new thing. Haven't seen or heard of it in a quarter of
a century. I know it's in MS Basic(s).

- Original Message -
From: Don Kibbey [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Friday, April 15, 2005 7:22 AM
Subject: Re: [U2] Multiple OPEN statements


 That programmer was probably squaked at for not closing a file or two.  
 Then he/she found a way to insure that would be caught next time by 
 the compiler.
 ---
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Multiple OPEN statements

2005-04-14 Thread Ken Wallis
Mark Johnson wrote:

 I just acquired a new client and found an interesting
 programming style that
 for the life of me I cannot understand why anyone in their
 right mind would do such a thing.

 Not on all programs but it seems that for programs that open
 less than 4-5
 files, the programmer continues the logic in the THEN section
 of the open statement. Example:

 OPEN FILE1 TO F.FILE1 THEN
 OPEN FILE2 TO F.FILE2 THEN
 OPEN FILE3 TO F.FILE3 THEN
 EOF=0
 LOOP READNEXT ID ELSE EOF=1 UNTIL EOF DO
 PROCESS, PROCESS, PROCESS
 REPEAT
 END ELSE PRINT CAN'T OPEN FILE3
 END ELSE PRINT CAN'T OPEN FILE2
 END ELSE PRINT CAN'T OPEN FILE1
 END

Yes Mark, this is a new fangled thing that I believe is called 'Structured
Programming'.  I suspect it'll never catch on, obviously it's only just
reaching your part of the world. ;^)

 There could be 200-300 lines between the OPEN for FILE3 and
 its error message.

Well, that part I don't like, but shit happens I suppose.  A bit like:

OPEN FILE1 TO F.FILE1 ELSE GOTO 999

where 999 is a long way away.

Personally, I'd code the above example as:

OPEN FILE1 TO F.FILE1 THEN
OPEN FILE2 TO F.FILE2 THEN
OPEN FILE3 TO F.FILE3 THEN
GOSUB PROCESS_STUFF
END ELSE PRINT CAN'T OPEN FILE3
END ELSE PRINT CAN'T OPEN FILE2
END ELSE PRINT CAN'T OPEN FILE1

STOP

PROCESS_STUFF:
EOF=0
LOOP READNEXT ID ELSE EOF=1 UNTIL EOF DO
PROCESS, PROCESS, PROCESS
REPEAT
RETURN

END

or even as:

GOSUB OPEN_FILES
IF SHIT_HAPPENED ELSE
GOSUB PROCESS_STUFF
END
STOP

OPEN_FILES:
SHIT_HAPPENED = 
OPEN FILE1 TO F.FILE1 THEN
OPEN FILE2 TO F.FILE2 THEN
OPEN FILE3 TO F.FILE3 ELSE
SHIT_HAPPENED = FILE3
END
END ELSE
SHIT_HAPPENED = FILE2
END
END ELSE
SHIT_HAPPENED = FILE1
END
IF SHIT_HAPPENED THEN
PRINT Can't open :SHIT_HAPPENED
END
RETURN

PROCESS_STUFF:
EOF=0
LOOP READNEXT ID ELSE EOF=1 UNTIL EOF DO
PROCESS, PROCESS, PROCESS
REPEAT
RETURN
END

 Now I know that Pick is pretty loose and forgiving. But what
 could be the sanity behind this.

You know the funny thing is that programmers who use decent editors don't
seem
to find the whole indentation thing so challenging. ;^)

Cheers,

Ken
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Multiple OPEN statements

2005-04-14 Thread Stevenson, Charles
 You know the funny thing is that programmers who use decent editors
 don't seem to find the whole indentation thing so challenging. ;^)
 
 Cheers,
 
 Ken


I once declared that UV's FORMAT (as verb or from ED) would be the
standard formatter.
Programmers grumbled.
I said the source is in APP.PROGS.  Change it if you prefer something
different.
No one did.


Speaking of editors,  I have an ED prestore macro that shows the level
of indentation. 
Very handy to line things up.

It show's Mark's program as:

0001:   OPEN FILE1 TO F.FILE1 THEN
0002: 1 |  OPEN FILE2 TO F.FILE2 THEN
0003: 2 |  |  OPEN FILE3 TO F.FILE3 THEN
0004: 3 |  |  |  EOF=0
0005: 3 |  |  |  LOOP READNEXT ID ELSE EOF=1 UNTIL EOF DO
0006: 4 |  |  |  |  PROCESS, PROCESS, PROCESS
0007: 3 |  |  |  REPEAT
0008: 2 |  |  END ELSE PRINT CAN'T OPEN FILE3
0009: 1 |  END ELSE PRINT CAN'T OPEN FILE2
0010:   END ELSE PRINT CAN'T OPEN FILE1
0011:END

ED LEVELS
0001: E
0002: BLOCK
0003: FORMAT
0004: C//~/B
0005: C/~ /9 |  |  |  |  |  |  |  |
|  /B
0006: C/~  /8 |  |  |  |  |  |  |  |  /B
0007: C/~   /7 |  |  |  |  |  |  |  /B
0008: C/~/6 |  |  |  |  |  |  /B
0009: C/~ /5 |  |  |  |  |  /B
0010: C/~  /4 |  |  |  |  /B
0011: C/~   /3 |  |  |  /B
0012: C/~/2 |  |  /B
0013: C/~ /1 |  /B
0014: C/~  /  /B
0015: C/~//B
0016: BLOCK
0017: PAUSE
0018: OOPS


Set the block usingcommands.
.X LEVELS
.XR at the pause prompt will OOPS it.

ED: the best of 70's technology!

- cds

P.S. Actually , I like UltraEdit.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/