Re: [U2] Reports In Universe BASIC

2007-03-18 Thread MAJ Programming
I often program report generating data/basic programs that will have a final
prompt that says Type S=Screen or P=Printer and the user can view the
report likewise.

Thus, I program that entire report with PRINT and let their answer dictate
whether it's under PRINTER ON or not.

BTW regarding styles and tricks I've learned. The MSG application has the
variable for the aforementioned question as SORP for Screen OR Printer. I
continue to use that variable for this method.

Given the mess of spaghetti that I've inherited with incredible
inconsistency, I feel good using consistent variable names, record names,
file handle syntaxes and label names/numbers. (No flames please on label
numbers. Sometimes the words get wordy)

I'll toss about another 'style' preference. I like to open files with a
consistent name (no flames on named commons, too hard to install
downstream). I use F.INVENTORY or D.INVENTORY for the data or dict level
respectively.

While there are no rules for file handle names, I personally don't care for
variable names that are not indicative of being a file handle. For example:

OPEN INVENTORY TO F.INVENTORY
OPEN INVENTORY TO INVENTORY.FILE
OPEN INVENTORY TO FILE.INVENTORY
OPEN INVENTORY TO INVENTORY.F
OPEN INVENTORY TO INV.F

are all indicative of the variable name being a file handle. (Again no
flames please on the use of periods or capital letters)

Having
OPEN INVENTORY TO INVENTORY
or
OPEN INVENTORY TO INV

is very confusing downstream.

Also, within an application, I would like the filenames to be consistent and
the same. The 5 line examples are all taken from a client's system that has
had 2 prior programmers propogating more than 2 styles. Pathetic. Plus, when
I do a FIND or SEARCH to see what programs use which files, it gets tricky
as I would have to scan for quote INVENTORY or double-quote INVENTORY.

One method that appeals to me but it hard to backfill into an existing app
is to have the file opened, dimensioned array created and the field names
equated in a single include. Thus, the entire app would be using the file
handles, dimensioned array names and the alias equates consistently named
(by insistence of the includes) and be much easier to read and learn. The
Primac applications do that.

Since most of my apps are the evolved result of an endless parade of prior
programmers, I inherit their 'styles' and move forward with my own. I have
yet to run into an example (except Primac) whereby I continue with a prior
style. If I'm adding to the confusion by introducing another style, I remind
myself that I am the current cook in the kitchen and new programs will have
my style and as time allows, changes to existing programs will be done in my
style. Sometimes it's easier to re-write the entire program instead of
trying to understand someone's stupid style.

My 2 cents.
Mark Johnson

- Original Message -
From: Anthony W. Youngman [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Friday, March 16, 2007 3:49 AM
Subject: Re: [U2] Reports In Universe BASIC


 In message [EMAIL PROTECTED], Kevin King
 [EMAIL PROTECTED] writes
 From: MAJ Programming
 Like helping the newbies with MV, I can now add this
 little tidbit to my mental library of techniques
 should the need arise.
 
 Just because one can doesn't mean one should.  In the case of PRINT ON
 working properly without a corresponding PRINTER ON, imagine six
 months later trying to find all of the programs that are outputting to
 the printer.  Not only do we have to search for procs and paragraphs
 that start the program with a (P (or LPTR) option, but now in
 searching through the BP code we have to search for both PRINTER ON
 and PRINT ON.  It's likely that someone will forget one of those
 options (and possibly a few others I may have missed in this quick
 post) and overlook a program that should have otherwise been found.

 But if it's your default style ALWAYS to use PRINT ON, then you won't
 forget it. Yes, I know there's loads of old code ...

 But using PRINT ON is sometimes necessary (printing several reports from
 one pass of the data), and prevents errors with PRINTER ON. Oh - and if
 you're going to go down your route, I'd enforce a style that said PRINT
 always prints to the printer, if you want the terminal, use CRT. That
 was the style used by a colleague of mine.

 So we had a real mix :-) Old stuff with PRINTER ON, my colleague using
 CRT for the terminal, and me using PRINT ON. I take your point, but
 these techniques are useful.

 Cheers,
 Wol
 --
 Anthony W. Youngman [EMAIL PROTECTED]
 'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
 thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The
man
 lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
 Visit the MaVerick web-site - http://www.maverick-dbms.org Open Source
Pick
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2

Re: [U2] Reports In Universe BASIC

2007-03-16 Thread Anthony W. Youngman
In message [EMAIL PROTECTED], MAJ 
Programming [EMAIL PROTECTED] writes

I will stand on my soapbox and shout that MV has no standards, just a lot of
styles. There is no governing body to enforce standards and if the remaining
providers (u2/uv/ d3 etc) were to build and force them, there would be some
disagreements at that level. If they concurred, then all of the existing
code underneath would have to be magically re-written or allowed to remain.
How coult anyone really prove that their 'style' should be the 'standard'.
Are we going to have a standards convention and hash over each MV topic from
loops, gotos, opens, dict items, procs, PRINT ON blah, blah.


And I'll stand on my soapbox and say that one of the MAJOR ADVANTAGES of 
Pick is that it doesn't enforce standards.


That's part of my complaint about RDBMSs - using them is a hell of a lot 
of work because if your data doesn't fit the standard (as it usually 
doesn't) then you have to force the real world into the straightjacket 
provided by the standard, rather than relax the straightjacket to fit 
the data. Basically, you're forced to act like a scientist throwing away 
the data that doesn't fit the theory instead of what a scientist is 
supposed to do - mould the theory to fit the data.


Cheers,
Wol
--
Anthony W. Youngman [EMAIL PROTECTED]
'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The man
lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
Visit the MaVerick web-site - http://www.maverick-dbms.org Open Source Pick
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Reports In Universe BASIC

2007-03-16 Thread Anthony W. Youngman
In message [EMAIL PROTECTED], Kevin King 
[EMAIL PROTECTED] writes

From: MAJ Programming

Like helping the newbies with MV, I can now add this
little tidbit to my mental library of techniques
should the need arise.


Just because one can doesn't mean one should.  In the case of PRINT ON
working properly without a corresponding PRINTER ON, imagine six
months later trying to find all of the programs that are outputting to
the printer.  Not only do we have to search for procs and paragraphs
that start the program with a (P (or LPTR) option, but now in
searching through the BP code we have to search for both PRINTER ON
and PRINT ON.  It's likely that someone will forget one of those
options (and possibly a few others I may have missed in this quick
post) and overlook a program that should have otherwise been found.


But if it's your default style ALWAYS to use PRINT ON, then you won't 
forget it. Yes, I know there's loads of old code ...


But using PRINT ON is sometimes necessary (printing several reports from 
one pass of the data), and prevents errors with PRINTER ON. Oh - and if 
you're going to go down your route, I'd enforce a style that said PRINT 
always prints to the printer, if you want the terminal, use CRT. That 
was the style used by a colleague of mine.


So we had a real mix :-) Old stuff with PRINTER ON, my colleague using 
CRT for the terminal, and me using PRINT ON. I take your point, but 
these techniques are useful.


Cheers,
Wol
--
Anthony W. Youngman [EMAIL PROTECTED]
'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The man
lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
Visit the MaVerick web-site - http://www.maverick-dbms.org Open Source Pick
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Reports In Universe BASIC

2007-03-16 Thread Kevin King
I don't have a problem with PRINT ON, I simply think that if you're
printing to the printer, at least say PRINTER ON so it's obvious.

We need the hippocratic oath for this industry.

http://www.hal-pc.org/~ollie/hippocratic.oath.html

-Kevin
[EMAIL PROTECTED]
http://www.PrecisOnline.com
 
** Check out scheduled Connect! training courses at
http://www.PrecisOnline.com/train.html.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Reports In Universe BASIC

2007-03-16 Thread Brutzman, Bill
True... but there is no hypocrisy in the Clap On... Clap Off...The
Clapper.

--Bill

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Kevin King
Sent: Friday, March 16, 2007 10:22 AM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Reports In Universe BASIC


I don't have a problem with PRINT ON, I simply think that if you're
printing to the printer, at least say PRINTER ON so it's obvious.

We need the hippocratic oath for this industry.

http://www.hal-pc.org/~ollie/hippocratic.oath.html

-Kevin
[EMAIL PROTECTED]
http://www.PrecisOnline.com
 
** Check out scheduled Connect! training courses at
http://www.PrecisOnline.com/train.html.
---
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] Reports In Universe BASIC

2007-03-15 Thread Anthony W. Youngman
In message [EMAIL PROTECTED], MAJ 
Programming [EMAIL PROTECTED] writes

No offense but what does PRINT ON have to do with PRINTER ON/OFF. They're
sorta unrelated.


But using PRINT ON means you don't need to use PRINTER ON/OFF

Most of my programming always sent reports to print unit 1. That way, 
whether I used CRT or PRINT was totally irrelevant - they both ALWAYS 
went to the terminal.


I have an issue with the code having PRINTER ON ; PRINT SOMETHING then
PRINTER OFF in the body of what is assumed to be a loop. It was replying to
someone's report request.


As I say, if the user had used PRINT ON 1 SOMETHING, then the PRINTER ON 
; PRINTER OFF lines could just have been deleted *completely* as 
redundant.


(Only thing is, it was then wise to finish the program with PRINTER 
CLOSE ON 1 otherwise your users would be saying where's my print job? 
Still stuck in the queue as pending and open :-)


Oh - and another big advantage for PRINT ON 1 - we had a very obscure 
bug where output to terminal would occasionally just die, and it was in 
the system for several years! I eventually discovered the cause - a 
report program did PRINTER ON at the start, PRINTER OFF at the end, and 
there was some obscure circumstance where it could exit without falling 
off the bottom of the code and executing the PRINTER OFF. We knew that 
was what was happening, because when the printout did appear it had all 
this crud at the end, but we just couldn't work out HOW it was 
happening. Especially as the users were dire at telling us what they'd 
done to cause it :-) Actually, I might have discovered and fixed the bug 
at the same time as I converted it to PRINT ON 1 to fix the problem ...


Cheers,
Wol


- Original Message -
From: Anthony W. Youngman [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Tuesday, March 13, 2007 4:45 AM
Subject: Re: [U2] Reports In Universe BASIC



In message [EMAIL PROTECTED], MAJ
Programming [EMAIL PROTECTED] writes
Here we go with the wide variety of 'examples'.

What is the sanity of PRINTER ON, then PRINT then PRINTER OFF?

Should we not be teaching PRINTER ON once and PRINTER OFF at the end?

I've only seen the redundant PRINTER ON, then PRINT then PRINTER OFF when
the programmer didn't know of CRT and was providing some PRINT @(x,y):ID
running dialog.

Or what I sometimes did (especially useful when creating two or three
reports from a single pass through a file...)

PRINT ON 1 ...

That was quite often used to generate a full report, summary, and stats,
all in one pass.

Cheers,
Wol
--
Anthony W. Youngman [EMAIL PROTECTED]
'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The

man

lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
Visit the MaVerick web-site - http://www.maverick-dbms.org Open Source

Pick

---
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/


--
Anthony W. Youngman [EMAIL PROTECTED]
'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The man
lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
Visit the MaVerick web-site - http://www.maverick-dbms.org Open Source Pick
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Reports In Universe BASIC

2007-03-15 Thread MAJ Programming
You CAN teach an old dog new tricks.

Given the endless combinations of using the statements, it hadn't occurred
to me that PRINT ON automatically prints to the printer as if PRINTER ON
were processed. I used PRINT ON twenty years ago for some simultaneous
reports that I was creating as new code but hadn't incorporated it into
today's use as a lot of reports are pre-existing and run multiple times.

You're one of the few people that I've run into that use PRINT ON. Also, I
have NEVER run into it in all of my years and systems that I've worked on.

Like helping the newbies with MV, I can now add this little tidbit to my
mental library of techniques should the need arise.

Thanks
Mark Johnson
- Original Message -
From: Anthony W. Youngman [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Thursday, March 15, 2007 4:37 AM
Subject: Re: [U2] Reports In Universe BASIC


 In message [EMAIL PROTECTED], MAJ
 Programming [EMAIL PROTECTED] writes
 No offense but what does PRINT ON have to do with PRINTER ON/OFF. They're
 sorta unrelated.

 But using PRINT ON means you don't need to use PRINTER ON/OFF

 Most of my programming always sent reports to print unit 1. That way,
 whether I used CRT or PRINT was totally irrelevant - they both ALWAYS
 went to the terminal.
 
 I have an issue with the code having PRINTER ON ; PRINT SOMETHING then
 PRINTER OFF in the body of what is assumed to be a loop. It was replying
to
 someone's report request.

 As I say, if the user had used PRINT ON 1 SOMETHING, then the PRINTER ON
 ; PRINTER OFF lines could just have been deleted *completely* as
 redundant.

 (Only thing is, it was then wise to finish the program with PRINTER
 CLOSE ON 1 otherwise your users would be saying where's my print job?
 Still stuck in the queue as pending and open :-)

 Oh - and another big advantage for PRINT ON 1 - we had a very obscure
 bug where output to terminal would occasionally just die, and it was in
 the system for several years! I eventually discovered the cause - a
 report program did PRINTER ON at the start, PRINTER OFF at the end, and
 there was some obscure circumstance where it could exit without falling
 off the bottom of the code and executing the PRINTER OFF. We knew that
 was what was happening, because when the printout did appear it had all
 this crud at the end, but we just couldn't work out HOW it was
 happening. Especially as the users were dire at telling us what they'd
 done to cause it :-) Actually, I might have discovered and fixed the bug
 at the same time as I converted it to PRINT ON 1 to fix the problem ...

 Cheers,
 Wol
 
 - Original Message -
 From: Anthony W. Youngman [EMAIL PROTECTED]
 To: u2-users@listserver.u2ug.org
 Sent: Tuesday, March 13, 2007 4:45 AM
 Subject: Re: [U2] Reports In Universe BASIC
 
 
  In message [EMAIL PROTECTED], MAJ
  Programming [EMAIL PROTECTED] writes
  Here we go with the wide variety of 'examples'.
  
  What is the sanity of PRINTER ON, then PRINT then PRINTER OFF?
  
  Should we not be teaching PRINTER ON once and PRINTER OFF at the end?
  
  I've only seen the redundant PRINTER ON, then PRINT then PRINTER OFF
when
  the programmer didn't know of CRT and was providing some PRINT
@(x,y):ID
  running dialog.
 
  Or what I sometimes did (especially useful when creating two or three
  reports from a single pass through a file...)
 
  PRINT ON 1 ...
 
  That was quite often used to generate a full report, summary, and
stats,
  all in one pass.
 
  Cheers,
  Wol
  --
  Anthony W. Youngman [EMAIL PROTECTED]
  'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking
the
  thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The
 man
  lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
  Visit the MaVerick web-site - http://www.maverick-dbms.org Open
Source
 Pick
  ---
  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/

 --
 Anthony W. Youngman [EMAIL PROTECTED]
 'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
 thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The
man
 lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
 Visit the MaVerick web-site - http://www.maverick-dbms.org Open Source
Pick
 ---
 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] Reports In Universe BASIC

2007-03-15 Thread Kevin King
From: MAJ Programming
Like helping the newbies with MV, I can now add this 
little tidbit to my mental library of techniques 
should the need arise.

Just because one can doesn't mean one should.  In the case of PRINT ON
working properly without a corresponding PRINTER ON, imagine six
months later trying to find all of the programs that are outputting to
the printer.  Not only do we have to search for procs and paragraphs
that start the program with a (P (or LPTR) option, but now in
searching through the BP code we have to search for both PRINTER ON
and PRINT ON.  It's likely that someone will forget one of those
options (and possibly a few others I may have missed in this quick
post) and overlook a program that should have otherwise been found.

As this jihad on upper/lower case has illustrated, there are many ways
to skin this U2 cat.  And the more ways we as a community use, the
harder we make it on ourselves to find something months after the
fact.  I dream of a day when programmers will have a response other
than who was the idiot who wrote this crap? when faced with
modifying someone else's program.  But alas, if this latest battle is
any indication, we're no closer to that day today than we were 20
years ago or possibly even 20 years before that.  And then we wonder
why our jobs are being shipped overseas?  It's pretty obvious, when
companies are faced with years and years of obfuscated and
unmaintainable code, why not get the same results from someone
overseas at a fraction of the price?

My intent is not to discourage my friends and esteeemed collegues in
this list, but rather to vent some frustration in the knowledge that
our communal past may be contributing to a negative impact on our
individual futures.  As a reasonably focused community (in contrast to
the millions of programmers in other environments) we have a real
fighting chance at turning this thing around, but if we can't find
some common ground on an issue as existentially meaningless as
upper/lower case then we shouldn't be surprised when the bottom
eventually falls out.

-Kevin
[EMAIL PROTECTED]
http://www.PrecisOnline.com
 
** Check out scheduled Connect! training courses at
http://www.PrecisOnline.com/train.html.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: Spam:RE: [U2] Reports In Universe BASIC

2007-03-15 Thread Jerry
This situation can be alleviated by setting up certain standards in your 
company and sticking to them. You don't have to go back and redo your legacy 
code but any new programs should stick to the new standards. If you need to 
do some extensive changes to an older program then perhaps you can bring the 
program up to date with the new standards by rebuilding it. Otherwise keep 
and modify the older program as it was originally designed. Eventually, if 
you stick with it, all of the programs will be up to your new standards. Of 
course, if history is any teacher, in another 5 years those standards will 
be considered out of date with the new designer software of the day. :-)
The following can be alleviated by setting a standard of using PRINT only 
when printing to a printer and CRT when displaying to a terminal. Then if 
you want to see which programs are print programs, search for PRINT.


Jerry

- Original Message - 
From: Kevin King [EMAIL PROTECTED]

To: u2-users@listserver.u2ug.org
Sent: Thursday, March 15, 2007 9:06 AM
Subject: Spam:RE: [U2] Reports In Universe BASIC



Just because one can doesn't mean one should.  In the case of PRINT ON
working properly without a corresponding PRINTER ON, imagine six
months later trying to find all of the programs that are outputting to
the printer.  Not only do we have to search for procs and paragraphs
that start the program with a (P (or LPTR) option, but now in
searching through the BP code we have to search for both PRINTER ON
and PRINT ON.  It's likely that someone will forget one of those

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


Re: [U2] Reports In Universe BASIC

2007-03-15 Thread MAJ Programming
I agree that scanning programs for concepts is made harder with this.

I inherit this kind of code and have been known to quote your quote. But I
must repeat that the train has left the MV station at the highest level.
Sure, a flavour (Ud/Uv/D3/Mvbase etc) may dictate standards but they have a
legacy to support. A VAR can dictate standards to their programmers for
programmer interchangability. And an end user can dictate their own
programming standards as well.

I would lean in the opposite of teaching standards (hold your flames).
Unless you're programming in a nicely controlled MV environment, where the
standards pre-exist that you must follow, you might as well get used to
being able to interpet many different methods for performing the same task.

I will stand on my soapbox and shout that MV has no standards, just a lot of
styles. There is no governing body to enforce standards and if the remaining
providers (u2/uv/ d3 etc) were to build and force them, there would be some
disagreements at that level. If they concurred, then all of the existing
code underneath would have to be magically re-written or allowed to remain.
How coult anyone really prove that their 'style' should be the 'standard'.
Are we going to have a standards convention and hash over each MV topic from
loops, gotos, opens, dict items, procs, PRINT ON blah, blah.

The train has left the station on this topic for us MV programmers. We all
develop our own styles and hash them about for the newbies to review. But
everything compiles, one plus one does equal two and we all get paid in the
end. Flame me if you wish. But offer some real counterpoints and not just
conjecture.

Respectfully
Mark Johnson
- Original Message -
From: Kevin King [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Thursday, March 15, 2007 9:06 AM
Subject: RE: [U2] Reports In Universe BASIC


 From: MAJ Programming
 Like helping the newbies with MV, I can now add this
 little tidbit to my mental library of techniques
 should the need arise.

 Just because one can doesn't mean one should.  In the case of PRINT ON
 working properly without a corresponding PRINTER ON, imagine six
 months later trying to find all of the programs that are outputting to
 the printer.  Not only do we have to search for procs and paragraphs
 that start the program with a (P (or LPTR) option, but now in
 searching through the BP code we have to search for both PRINTER ON
 and PRINT ON.  It's likely that someone will forget one of those
 options (and possibly a few others I may have missed in this quick
 post) and overlook a program that should have otherwise been found.

 As this jihad on upper/lower case has illustrated, there are many ways
 to skin this U2 cat.  And the more ways we as a community use, the
 harder we make it on ourselves to find something months after the
 fact.  I dream of a day when programmers will have a response other
 than who was the idiot who wrote this crap? when faced with
 modifying someone else's program.  But alas, if this latest battle is
 any indication, we're no closer to that day today than we were 20
 years ago or possibly even 20 years before that.  And then we wonder
 why our jobs are being shipped overseas?  It's pretty obvious, when
 companies are faced with years and years of obfuscated and
 unmaintainable code, why not get the same results from someone
 overseas at a fraction of the price?

 My intent is not to discourage my friends and esteeemed collegues in
 this list, but rather to vent some frustration in the knowledge that
 our communal past may be contributing to a negative impact on our
 individual futures.  As a reasonably focused community (in contrast to
 the millions of programmers in other environments) we have a real
 fighting chance at turning this thing around, but if we can't find
 some common ground on an issue as existentially meaningless as
 upper/lower case then we shouldn't be surprised when the bottom
 eventually falls out.

 -Kevin
 [EMAIL PROTECTED]
 http://www.PrecisOnline.com

 ** Check out scheduled Connect! training courses at
 http://www.PrecisOnline.com/train.html.
 ---
 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] Reports In Universe BASIC

2007-03-14 Thread Anthony W. Youngman
In message [EMAIL PROTECTED], MAJ 
Programming [EMAIL PROTECTED] writes

Here we go with the wide variety of 'examples'.

What is the sanity of PRINTER ON, then PRINT then PRINTER OFF?

Should we not be teaching PRINTER ON once and PRINTER OFF at the end?

I've only seen the redundant PRINTER ON, then PRINT then PRINTER OFF when
the programmer didn't know of CRT and was providing some PRINT @(x,y):ID
running dialog.


Or what I sometimes did (especially useful when creating two or three 
reports from a single pass through a file...)


PRINT ON 1 ...

That was quite often used to generate a full report, summary, and stats, 
all in one pass.


Cheers,
Wol
--
Anthony W. Youngman [EMAIL PROTECTED]
'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The man
lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
Visit the MaVerick web-site - http://www.maverick-dbms.org Open Source Pick
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Reports In Universe BASIC

2007-03-14 Thread MAJ Programming
No offense but what does PRINT ON have to do with PRINTER ON/OFF. They're
sorta unrelated.

I have an issue with the code having PRINTER ON ; PRINT SOMETHING then
PRINTER OFF in the body of what is assumed to be a loop. It was replying to
someone's report request.

- Original Message -
From: Anthony W. Youngman [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Tuesday, March 13, 2007 4:45 AM
Subject: Re: [U2] Reports In Universe BASIC


 In message [EMAIL PROTECTED], MAJ
 Programming [EMAIL PROTECTED] writes
 Here we go with the wide variety of 'examples'.
 
 What is the sanity of PRINTER ON, then PRINT then PRINTER OFF?
 
 Should we not be teaching PRINTER ON once and PRINTER OFF at the end?
 
 I've only seen the redundant PRINTER ON, then PRINT then PRINTER OFF when
 the programmer didn't know of CRT and was providing some PRINT @(x,y):ID
 running dialog.

 Or what I sometimes did (especially useful when creating two or three
 reports from a single pass through a file...)

 PRINT ON 1 ...

 That was quite often used to generate a full report, summary, and stats,
 all in one pass.

 Cheers,
 Wol
 --
 Anthony W. Youngman [EMAIL PROTECTED]
 'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
 thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The
man
 lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
 Visit the MaVerick web-site - http://www.maverick-dbms.org Open Source
Pick
 ---
 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] Reports In Universe BASIC

2007-03-13 Thread Allen E. Elwood
Wasn't trying to be quick...

Some people like headings that are not fancy, some people like fancy.  More
people like fancy than non fancy.  57 lines of code isn't squat on a hard
drive that can handle 60 hours of digital video, eh?  I have been
programming since 1974, professionally since 1978.  Could it have been done
as a subr?  Yeah, sure.  Is a subr slower?  Yeah, sure...  57 lines of code,
times a 100 reports, not even close to being huge.  Very tiny on a 250gb
drive.

No offence taken!  I was actually replying to your post, not the newbie, for
*ideas*.  Using a basic program to ask questions, form the headings based on
the answers, form the query based on the answers, then PERFORM it creates a
basic program-like output without a lot of work.  And it also creates an
easy to use skeleton that can be copied and modified with ease to make new
reports that look fantastic, with very little work.  And all
questions/options handling is done in BASIC instead of proc language which
does change quite a bit depending on what platform you're on, and what
flavor the installation is.

Remember the recent Dilbert, after creating an enormous database of
actualized goals, the raises were handed out on how the employees looked.
The way a report *looks* counts for *a lot* of how the programmer is
perceived by management.

And I don't straddle a lot of platforms.  My headings are actually my own
version which is similar to the ones used on Manage-2000.  *All* headings on
all M2K reports have almost exactly the same format, although it's a
completely different code that I wrote from scratch since theirs was kind of
dumb and more code...

MCL makes it lower case, which is what I wanted, not MCT, remember I said
this was MvBASE code.

Easy to understand is only necessary for code you want to change.  Sometimes
when you create code that is good enough to keep the same, maintenance is
not necessary.  Headings, like record locking, can be written once and
forgotten if enough options are written in.  M2K's headings have been
virtually the same since 1980 or so.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of MAJ Programming
Sent: Monday, March 12, 2007 17:22
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Reports In Universe BASIC


Again, some quicker methods:

1. U50BB is supported on all platforms. Use it for the Port and Account and
possibly the user-id. Put this stuff in an external sub called GET.PORT or
GET.ACCT or GET.USER to not re-invent it every time. Plus, if you straddle
platforms like I do, I can always use CALL GET.PORT(PORT) and only
platform-ize it once.

2. The Date  TIme stuff is overly fancy. Just use TIMEDATE() as it matches
the 'T' part of the heading/footing string. Or use 'D'.

3. Your DAY=  thing on line #3 should just be an MCT for mixed casing.

4. Does not Ud  UV support the 'C' expression in headings/footings as well
as the justification C#132? I miss it on D3.

I'm a very experienced MV programmer and to have 57 lines of code devoted to
headings is, IMHO, excessive. If the home-rule 'standard' were to have
consistent headings, put this in a subroutine and just pass the titles to
it. I hope every program doesn't start like this.

No offense, but this is a lot to show for headings to a newbie. It may
intimidate and he may believe that they all must be this busy.

One thing that will come from these submitted program snippets is the review
and suggestions for improvement. As I have traveled on perhaps 50-60
different MV systems in my career, I've certainly seen many code samples
that I want to use again and many that I want to replace. I'm not the best
but I feel that I can offer up pretty useful opinions on what is easy-to
read and understand code.

Respectfully,
Mark Johnson
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Reports In Universe BASIC

2007-03-13 Thread MAJ Programming
I am blessed with having transversed through over mv 60 systems in my
career. That gives me some methods to compare when desiring the same
function.

I submit what I consider the best method that I have accumulated. I am
always open for new methods for these building blocks of code snippets.

Not working with any 4GL's, my world is 90% hand-written source code (both
mine and what I inherit). The other 10% was from source code generators
which vary widely in their usefullness.

Since I don't get paid by the line, I tend to KISS. So using the most brief
piece of code for each task is paramount. Plus, I can write these subs once
per platform and use them continuously without being platform concerned.

I offer MCT as the code indicated to keep the first character as-is and MCL
the [2,1000] of it. If the text were multiple words and you wanted only the
first word capitalized, then I stand corrected.

I inherit lots of code. It amazes me what differences there are working
towards the same goal.

My 1 cent.
Mark Johnson
- Original Message -
From: Allen E. Elwood [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Tuesday, March 13, 2007 12:31 PM
Subject: RE: [U2] Reports In Universe BASIC


 Wasn't trying to be quick...

 Some people like headings that are not fancy, some people like fancy.
More
 people like fancy than non fancy.  57 lines of code isn't squat on a hard
 drive that can handle 60 hours of digital video, eh?  I have been
 programming since 1974, professionally since 1978.  Could it have been
done
 as a subr?  Yeah, sure.  Is a subr slower?  Yeah, sure...  57 lines of
code,
 times a 100 reports, not even close to being huge.  Very tiny on a 250gb
 drive.

 No offence taken!  I was actually replying to your post, not the newbie,
for
 *ideas*.  Using a basic program to ask questions, form the headings based
on
 the answers, form the query based on the answers, then PERFORM it creates
a
 basic program-like output without a lot of work.  And it also creates an
 easy to use skeleton that can be copied and modified with ease to make new
 reports that look fantastic, with very little work.  And all
 questions/options handling is done in BASIC instead of proc language which
 does change quite a bit depending on what platform you're on, and what
 flavor the installation is.

 Remember the recent Dilbert, after creating an enormous database of
 actualized goals, the raises were handed out on how the employees looked.
 The way a report *looks* counts for *a lot* of how the programmer is
 perceived by management.

 And I don't straddle a lot of platforms.  My headings are actually my own
 version which is similar to the ones used on Manage-2000.  *All* headings
on
 all M2K reports have almost exactly the same format, although it's a
 completely different code that I wrote from scratch since theirs was kind
of
 dumb and more code...

 MCL makes it lower case, which is what I wanted, not MCT, remember I said
 this was MvBASE code.

 Easy to understand is only necessary for code you want to change.
Sometimes
 when you create code that is good enough to keep the same, maintenance is
 not necessary.  Headings, like record locking, can be written once and
 forgotten if enough options are written in.  M2K's headings have been
 virtually the same since 1980 or so.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of MAJ Programming
 Sent: Monday, March 12, 2007 17:22
 To: u2-users@listserver.u2ug.org
 Subject: Re: [U2] Reports In Universe BASIC


 Again, some quicker methods:

 1. U50BB is supported on all platforms. Use it for the Port and Account
and
 possibly the user-id. Put this stuff in an external sub called GET.PORT or
 GET.ACCT or GET.USER to not re-invent it every time. Plus, if you straddle
 platforms like I do, I can always use CALL GET.PORT(PORT) and only
 platform-ize it once.

 2. The Date  TIme stuff is overly fancy. Just use TIMEDATE() as it
matches
 the 'T' part of the heading/footing string. Or use 'D'.

 3. Your DAY=  thing on line #3 should just be an MCT for mixed casing.

 4. Does not Ud  UV support the 'C' expression in headings/footings as
well
 as the justification C#132? I miss it on D3.

 I'm a very experienced MV programmer and to have 57 lines of code devoted
to
 headings is, IMHO, excessive. If the home-rule 'standard' were to have
 consistent headings, put this in a subroutine and just pass the titles to
 it. I hope every program doesn't start like this.

 No offense, but this is a lot to show for headings to a newbie. It may
 intimidate and he may believe that they all must be this busy.

 One thing that will come from these submitted program snippets is the
review
 and suggestions for improvement. As I have traveled on perhaps 50-60
 different MV systems in my career, I've certainly seen many code samples
 that I want to use again and many that I want to replace. I'm not the best
 but I feel that I can offer up pretty useful opinions

[U2] Reports In Universe BASIC

2007-03-12 Thread Sanjeebkumar Sarangi
Hi

What type of report is generated in Universe Basic ?
Can any one tell me how to write a program that will generate a report ?
Please give me some example that will provide me a clear idea regarding
reports generation in Universe Basic.

Sanjeeb
=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Reports In Universe BASIC

2007-03-12 Thread MAJ Programming
Can't wait for the answers on this one.

My submissions are:
1. External SSELECT then report formatting in Basic.
2. Parameters gathered in BASIC then report formatting in Basic.
3. Parameters gathered in BASIC then create an EXECUTEable TCL statement for
the report.

This thread should get interesting. Refer to last week's Anita and Marinko's
newbie requests and this falls directly into it.

My side bet is going to be how differently BREAK-ON's are handled with
Basic. Also, the inclusion of secondary files, simultaneous report sections
etc. This could get ugly.

My 1 cent
Mark Johnson
- Original Message -
From: Sanjeebkumar Sarangi [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Monday, March 12, 2007 7:00 AM
Subject: [U2] Reports In Universe BASIC


 Hi

 What type of report is generated in Universe Basic ?
 Can any one tell me how to write a program that will generate a report ?
 Please give me some example that will provide me a clear idea regarding
 reports generation in Universe Basic.

 Sanjeeb
 =-=-=
 Notice: The information contained in this e-mail
 message and/or attachments to it may contain
 confidential or privileged information. If you are
 not the intended recipient, any dissemination, use,
 review, distribution, printing or copying of the
 information contained in this e-mail message
 and/or attachments to it are strictly prohibited. If
 you have received this communication in error,
 please notify us by reply e-mail or telephone and
 immediately and permanently delete the message
 and any attachments. Thank you
 ---
 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] Reports In Universe BASIC

2007-03-12 Thread brian
Here is a simple example.

It uses two files: BOOK_AUTHORS and BOOK_TITLES. The BOOK_AUTHOR has a 
multivalued list of IDs for titles by that author. The program prints the 
author name followed by the titles in ascending order.

It's an example from a developers course I run.

You can download the demo files from my website: www.brianleach.co.uk.



  PROGRAM printauthor
*--
*  Name: printauthor
*  Description : Print author details
*  Author  : Brian Leach
*  Project :
*  Module  : GENERAL
*--
*  Notes
*  -
*--
*  Modification History
*  
*
*  DateWho  Version Description
*  ---  --- ---
*--
*  Version Stamp
*  -
*--
* Print an author summary including a list of titles
* This version selects the author by name using a separate select list

EQU AUTHOR.FULLNAME To 1
EQU AUTHOR.TITLES   To 3

EQU TITLE.NAME  To 1
EQU TITLE.ISBN  To 8
EQU TITLE.PRICE To 9

  Open BOOK_TITLES To BOOKTITLES Else
 Crt Cannot open the BOOK_TITLES File
 STOP
  End

  Open BOOK_AUTHORS To BOOKAUTHORS Else
 Crt Cannot open the BOOK_AUTHORS File
 STOP
  End

  Open BOOK_READERS To BOOKREADERS Else
 Crt Cannot open the BOOK_READERS File
 STOP
  End


  Prompt 

  Crt Enter an author name : :
  Input AuthorName
  If AuthorName =  Then
 STOP
  End

  Cmd = 'SELECT BOOK_AUTHORS WITH FULLNAME LIKE ...':AuthorName:'...'
  Execute Cmd, SELECT.  AUTHORLIST

  Printer On
  Loop
 ReadNext AuthorId FROM AUTHORLIST Else
Crt Enter an author id : :
Input AuthorId
 End
  Until AuthorId =  Do

* first read the author details

 Read AuthorRec From BOOKAUTHORS, AuthorId Then
Gosub PrintAuthor
 End

  Repeat
  Printer Off
  Printer Close

  RETURN

*---
* PrintAuthor
*---
PrintAuthor:

  Print
  Print Author Name : :AuthorRecAUTHOR.FULLNAME
  Print

  NumTitles = DCount(AuthorRecAUTHOR.TITLES,@VM) ; * Count number 
of values

  * create a set of display variables
  TitleIds = 

  Titles = 
  Prices = 
  Units = 
  ISBNs = 


  * Build up the list of titles in order
  For I = 1 To NumTitles
 TitleId = AuthorRecAUTHOR.TITLES,I
 Read TitleRec From BOOKTITLES, TitleId Then
Locate TitleRecTITLE.NAME In Titles BY AL Setting Pos Else
   Ins TitleRecTITLE.NAME before TitlesPos
   Ins TitleId Before TitleIdsPos
   Ins TitleRecTITLE.ISBN Before ISBNsPos
   Ins OConv(TitleRecTITLE.PRICE,MD2) Before PricesPos
End
 End
  Next

  
 Print Id L.5: :
 Print Title L.40: :
 Print ISBN L.12: :
 Print Price R.7
 Print

  * Now display the list
  For I = 1 To NumTitles
 Print TitleIdsI L#5: :
 Print TitlesI L#40: :
 Print ISBNsI L#12: :
 Print PricesI R#7
  Next

  Return


---


Hi

What type of report is generated in Universe Basic ?
Can any one tell me how to write a program that will generate a report ?
Please give me some example that will provide me a clear idea regarding
reports generation in Universe Basic.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Reports In Universe BASIC

2007-03-12 Thread Louie Gouws
Hi

Once you have gotten the hang of the program to print something you will
have more questions but this example will start you off

Louie

--
*-- sample to illustrate how a report will be printed using U-Basic
*-- all bells and whistles to be added as soon as conceptual understanding
*-- is there
*
* open the file you want to report on
*
OPEN 'MASTERFILE' TO FILE ELSE STOP
*
* build the 'tcl' sentence to select the file
*
SENT='SSELECT MASTERFILE BY SURNAME'
EXECUTE SEN RETURNING NO.SELECTED
*
* if no items present then do whatever, like stop
*
IF NO.SELECTED = 0 THEN STOP
*
* loop thru the records
EOF=0
LOOP
  READNEXT KEY ELSE EOF=1
UNTIL EOF DO
  READ REC FROM FILE,KEY THEN
GOSUB PRINT.LINE
  END
REPEAT
STOP
*--
*--
PRINT.LINE:
*--
* rec1= the surname using 30 chars left justified
* rec2= the name using 15 chars left justified
* rec3= amount , converted to .00 and 10 chars right justified
  PRINTER ON
  LN=REC1 'L#30':REC2:'L#15':OCONV(REC3,'MD2') 'R#10'
  PRINT LN
  PRINTER OFF
*
RETURN


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sanjeebkumar
Sarangi
Sent: 12 March 2007 14:01
To: u2-users@listserver.u2ug.org
Subject: [U2] Reports In Universe BASIC

Hi

What type of report is generated in Universe Basic ?
Can any one tell me how to write a program that will generate a report ?
Please give me some example that will provide me a clear idea regarding
reports generation in Universe Basic.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Reports In Universe BASIC

2007-03-12 Thread Allen E. Elwood
How about first some query questions written in basic regarding the options
available, and then followed by an internal building of the headings so left
parts are left justified, center parts are center justified, right parts are
right justified, and then building query statement within the program and
PERFORM'ing that?

This is what I do for a MvBASE client and the results are really nice.
Multiple options selected can be included as part of the headings, and it's
easy as pie since I have variables that I just plop in the options selected
and the programming does the auto-justification!

This way I can do things normally only 'doable' in a program, but still let
the query language do all the reporting work.  Headings come out perfectly
every time and the first time with no guessing.  Different options selected
which in a proc would throw the headings off, still come out perfect.

SETUP.HEADINGS:
  RPT.HDNG= 'Report Title Goes Here'
  RPT.HDNG2 = OPTION.TEXT
  LINE.SIZE   = 132
  COMPANY = 'Client Name Goes Here'
  *#* GENERIC HEADINGS DO NOT MODIFY THIS CODE
  *
  IF NOT(MOD(LEN(COMPANY),2)) THEN COMPANY = ' ':COMPANY
  HALF.SIZE = INT(LINE.SIZE/2)
  OPEN '', 'SYSTEM' TO SYSTEM ELSE STOP CANNOT OPEN SYSTEM FILE
  LOGON = SYSTEM(19)
  PORT  = SYSTEM(18)
  READ SYS.REC FROM SYSTEM, LOGON ELSE SYS.REC = ''
  IF SYS.REC1 = 'D' THEN
LOGON.ACCOUNT = LOGON
  END ELSE
LOGON.ACCOUNT = SYS.REC2
  END
  *
  IDATE = DATE()
  TEMP  = OCONV(IDATE,'DWA')
  DAY   = TEMP[1,1]:OCONV(TEMP[2,10],'MCL')
  TIME  = OCONV(TIME(),'MTH')
  DATE  = OCONV(IDATE,'D2/')
  *
  SEC.1 = PGM.NAME:' ':TIME
  SEC.2 = COMPANY
  SEC.3 = 'Port ':PORT:' Acct ':LOGON.ACCOUNT[40]:'  Page'
  L2SC1 = DAY:' ':DATE

  *
  SEC.1.LEN = LEN(SEC.1)
  SEC.2.LEN = INT(LEN(SEC.2)/2)
  SEC.3.LEN = LEN(SEC.3)+5 ; *Add five digits to account for space  page #
at eol
  *
  L2SC1.LEN = LEN(L2SC1)
  RPT1H.LEN = INT(LEN(RPT.HDNG1)/2)
  *
  HDNG.1= ''
  HDNG.1[1,SEC.1.LEN]   = SEC.1
  HDNG.1[HALF.SIZE - SEC.2.LEN] = SEC.2
  HDNG.1[LINE.SIZE - SEC.3.LEN] = SEC.3
  *
  HDNG.1 = HDNG.1[1,LINE.SIZE-5]
  *
  HDNG.2= ''
  HDNG.2[1,L2SC1.LEN]   = L2SC1
  HDNG.2[HALF.SIZE - RPT1H.LEN] = RPT.HDNG1
  *
  HDNG.3   = SPACE(HALF.SIZE-LEN(RPT.HDNG2)/2):RPT.HDNG2
  HDNG.4   = SPACE(HALF.SIZE-LEN(RPT.HDNG3)/2):RPT.HDNG3
  HDNG.5   = SPACE(HALF.SIZE-LEN(RPT.HDNG4)/2):RPT.HDNG4
  PAGE.CNT = 0
  LINE.CNT = 99
  *
  *#* END OF GENERIC HEADINGS
  *
  * Now make what would normally be headings in a program, into PICK
headings
  HDNG.1 := ':'PL':'
  HDNG.2 := ':'L':'
  HDNG.3 := ':'L':'
  HEADINGS = HDNG.1:HDNG.2:HDNG.3
  RETURN

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of MAJ Programming
Sent: Monday, March 12, 2007 06:33
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Reports In Universe BASIC


Can't wait for the answers on this one.

My submissions are:
1. External SSELECT then report formatting in Basic.
2. Parameters gathered in BASIC then report formatting in Basic.
3. Parameters gathered in BASIC then create an EXECUTEable TCL statement for
the report.

This thread should get interesting. Refer to last week's Anita and Marinko's
newbie requests and this falls directly into it.

My side bet is going to be how differently BREAK-ON's are handled with
Basic. Also, the inclusion of secondary files, simultaneous report sections
etc. This could get ugly.

My 1 cent
Mark Johnson
- Original Message -
From: Sanjeebkumar Sarangi [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Monday, March 12, 2007 7:00 AM
Subject: [U2] Reports In Universe BASIC


 Hi

 What type of report is generated in Universe Basic ?
 Can any one tell me how to write a program that will generate a report ?
 Please give me some example that will provide me a clear idea regarding
 reports generation in Universe Basic.

 Sanjeeb
 =-=-=
 Notice: The information contained in this e-mail
 message and/or attachments to it may contain
 confidential or privileged information. If you are
 not the intended recipient, any dissemination, use,
 review, distribution, printing or copying of the
 information contained in this e-mail message
 and/or attachments to it are strictly prohibited. If
 you have received this communication in error,
 please notify us by reply e-mail or telephone and
 immediately and permanently delete the message
 and any attachments. Thank you
 ---
 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] Reports In Universe BASIC

2007-03-12 Thread MAJ Programming
Here we go with the wide variety of 'examples'.

What is the sanity of PRINTER ON, then PRINT then PRINTER OFF?

Should we not be teaching PRINTER ON once and PRINTER OFF at the end?

I've only seen the redundant PRINTER ON, then PRINT then PRINTER OFF when
the programmer didn't know of CRT and was providing some PRINT @(x,y):ID
running dialog.

Plus, the EOF=0 then EOF=1 concept is also pretty Jurrasic. Most MV
implementations will support:

LOOP WHILE READNEXT KEY DO
or
LOOP READNEXT KEY ELSE EXIT UNTIL 0 DO

and avoid the extra 'flags' and statements.

Also, LN is a function and should not be used as a variable. Compiles? Yes,
In the future? Maybe.

My 1 cent.
Mark Johnson
- Original Message -
From: Louie Gouws [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Monday, March 12, 2007 10:03 AM
Subject: RE: [U2] Reports In Universe BASIC


 Hi

 Once you have gotten the hang of the program to print something you will
 have more questions but this example will start you off

 Louie

 --
 *-- sample to illustrate how a report will be printed using U-Basic
 *-- all bells and whistles to be added as soon as conceptual understanding
 *-- is there
 *
 * open the file you want to report on
 *
 OPEN 'MASTERFILE' TO FILE ELSE STOP
 *
 * build the 'tcl' sentence to select the file
 *
 SENT='SSELECT MASTERFILE BY SURNAME'
 EXECUTE SEN RETURNING NO.SELECTED
 *
 * if no items present then do whatever, like stop
 *
 IF NO.SELECTED = 0 THEN STOP
 *
 * loop thru the records
 EOF=0
 LOOP
   READNEXT KEY ELSE EOF=1
 UNTIL EOF DO
   READ REC FROM FILE,KEY THEN
 GOSUB PRINT.LINE
   END
 REPEAT
 STOP
 *--
 *--
 PRINT.LINE:
 *--
 * rec1= the surname using 30 chars left justified
 * rec2= the name using 15 chars left justified
 * rec3= amount , converted to .00 and 10 chars right justified
   PRINTER ON
   LN=REC1 'L#30':REC2:'L#15':OCONV(REC3,'MD2') 'R#10'
   PRINT LN
   PRINTER OFF
 *
 RETURN


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Sanjeebkumar
 Sarangi
 Sent: 12 March 2007 14:01
 To: u2-users@listserver.u2ug.org
 Subject: [U2] Reports In Universe BASIC

 Hi

 What type of report is generated in Universe Basic ?
 Can any one tell me how to write a program that will generate a report ?
 Please give me some example that will provide me a clear idea regarding
 reports generation in Universe Basic.
 ---
 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] Reports In Universe BASIC

2007-03-12 Thread MAJ Programming
Again, some quicker methods:

1. U50BB is supported on all platforms. Use it for the Port and Account and
possibly the user-id. Put this stuff in an external sub called GET.PORT or
GET.ACCT or GET.USER to not re-invent it every time. Plus, if you straddle
platforms like I do, I can always use CALL GET.PORT(PORT) and only
platform-ize it once.

2. The Date  TIme stuff is overly fancy. Just use TIMEDATE() as it matches
the 'T' part of the heading/footing string. Or use 'D'.

3. Your DAY=  thing on line #3 should just be an MCT for mixed casing.

4. Does not Ud  UV support the 'C' expression in headings/footings as well
as the justification C#132? I miss it on D3.

I'm a very experienced MV programmer and to have 57 lines of code devoted to
headings is, IMHO, excessive. If the home-rule 'standard' were to have
consistent headings, put this in a subroutine and just pass the titles to
it. I hope every program doesn't start like this.

No offense, but this is a lot to show for headings to a newbie. It may
intimidate and he may believe that they all must be this busy.

One thing that will come from these submitted program snippets is the review
and suggestions for improvement. As I have traveled on perhaps 50-60
different MV systems in my career, I've certainly seen many code samples
that I want to use again and many that I want to replace. I'm not the best
but I feel that I can offer up pretty useful opinions on what is easy-to
read and understand code.

Respectfully,
Mark Johnson
- Original Message -
From: Allen E. Elwood [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Monday, March 12, 2007 1:39 PM
Subject: RE: [U2] Reports In Universe BASIC


 How about first some query questions written in basic regarding the
options
 available, and then followed by an internal building of the headings so
left
 parts are left justified, center parts are center justified, right parts
are
 right justified, and then building query statement within the program and
 PERFORM'ing that?

 This is what I do for a MvBASE client and the results are really nice.
 Multiple options selected can be included as part of the headings, and
it's
 easy as pie since I have variables that I just plop in the options
selected
 and the programming does the auto-justification!

 This way I can do things normally only 'doable' in a program, but still
let
 the query language do all the reporting work.  Headings come out perfectly
 every time and the first time with no guessing.  Different options
selected
 which in a proc would throw the headings off, still come out perfect.

 SETUP.HEADINGS:
   RPT.HDNG= 'Report Title Goes Here'
   RPT.HDNG2 = OPTION.TEXT
   LINE.SIZE   = 132
   COMPANY = 'Client Name Goes Here'
   *#* GENERIC HEADINGS DO NOT MODIFY THIS CODE
   *
   IF NOT(MOD(LEN(COMPANY),2)) THEN COMPANY = ' ':COMPANY
   HALF.SIZE = INT(LINE.SIZE/2)
   OPEN '', 'SYSTEM' TO SYSTEM ELSE STOP CANNOT OPEN SYSTEM FILE
   LOGON = SYSTEM(19)
   PORT  = SYSTEM(18)
   READ SYS.REC FROM SYSTEM, LOGON ELSE SYS.REC = ''
   IF SYS.REC1 = 'D' THEN
 LOGON.ACCOUNT = LOGON
   END ELSE
 LOGON.ACCOUNT = SYS.REC2
   END
   *
   IDATE = DATE()
   TEMP  = OCONV(IDATE,'DWA')
   DAY   = TEMP[1,1]:OCONV(TEMP[2,10],'MCL')
   TIME  = OCONV(TIME(),'MTH')
   DATE  = OCONV(IDATE,'D2/')
   *
   SEC.1 = PGM.NAME:' ':TIME
   SEC.2 = COMPANY
   SEC.3 = 'Port ':PORT:' Acct ':LOGON.ACCOUNT[40]:'  Page'
   L2SC1 = DAY:' ':DATE

   *
   SEC.1.LEN = LEN(SEC.1)
   SEC.2.LEN = INT(LEN(SEC.2)/2)
   SEC.3.LEN = LEN(SEC.3)+5 ; *Add five digits to account for space  page
#
 at eol
   *
   L2SC1.LEN = LEN(L2SC1)
   RPT1H.LEN = INT(LEN(RPT.HDNG1)/2)
   *
   HDNG.1= ''
   HDNG.1[1,SEC.1.LEN]   = SEC.1
   HDNG.1[HALF.SIZE - SEC.2.LEN] = SEC.2
   HDNG.1[LINE.SIZE - SEC.3.LEN] = SEC.3
   *
   HDNG.1 = HDNG.1[1,LINE.SIZE-5]
   *
   HDNG.2= ''
   HDNG.2[1,L2SC1.LEN]   = L2SC1
   HDNG.2[HALF.SIZE - RPT1H.LEN] = RPT.HDNG1
   *
   HDNG.3   = SPACE(HALF.SIZE-LEN(RPT.HDNG2)/2):RPT.HDNG2
   HDNG.4   = SPACE(HALF.SIZE-LEN(RPT.HDNG3)/2):RPT.HDNG3
   HDNG.5   = SPACE(HALF.SIZE-LEN(RPT.HDNG4)/2):RPT.HDNG4
   PAGE.CNT = 0
   LINE.CNT = 99
   *
   *#* END OF GENERIC HEADINGS
   *
   * Now make what would normally be headings in a program, into PICK
 headings
   HDNG.1 := ':'PL':'
   HDNG.2 := ':'L':'
   HDNG.3 := ':'L':'
   HEADINGS = HDNG.1:HDNG.2:HDNG.3
   RETURN

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of MAJ Programming
 Sent: Monday, March 12, 2007 06:33
 To: u2-users@listserver.u2ug.org
 Subject: Re: [U2] Reports In Universe BASIC


 Can't wait for the answers on this one.

 My submissions are:
 1. External SSELECT then report formatting in Basic.
 2. Parameters gathered in BASIC then report formatting in Basic.
 3. Parameters gathered in BASIC then create an EXECUTEable TCL statement
for
 the report.

 This thread should get interesting. Refer to last week's Anita