I like it!  I use something very similar in concept that I wrote.  Since
we are an Activant/Prelude customer, we are SB+ users and the generator
takes that into account.  I still wind up writing a lot of Basic, so I
did this to insure consistency in my programs.  The program framework
has evolved from 10 years of trying different things. It winds of being
a pragmatic collection of methods that have worked well for me in a
variety of situations.  I tried your generator using just two file names
and no parameters.  Then I ran the same stuff through mine.  Here is
what yours produced:

SUBROUTINE TEST.IT
* TEST.IT
* by Norman Morgan ([EMAIL PROTECTED])
* on Thursday, 2007/07/26
* ********************
* Change History *
* Name...... Date...... Summary of Change.....
* Skel       2007/07/26 Created
* ********************
*
* Initialization
*
GOSUB HOUSEKEEPING
*
* Main Logic
*
DONE = 0
LOOP
   * <INSERT YOUR MAIN TEST HERE> *
UNTIL DONE DO
   GOSUB PROCESS.ONE
REPEAT
*
STOP; * Logical End of Program
*
* Start of Subroutines
*
HOUSEKEEPING:
*
* Variable initialization
*
* File Opens
FERR = ""
*
OPEN 'CUSTOMER' TO CUSTOMER.FILE ELSE FERR := ""
OPEN 'PRODUCT' TO PRODUCT.FILE ELSE FERR := ""
OPEN '' TO .FILE ELSE FERR := ""
IF FERR # "" THEN ABORT 201, FERR
RETURN
*
PROCESS.ONE:
* <INSERT YOUR MAIN ACTION HERE>
RETURN
*
* <INSERT YOUR ADDITIONAL INTERNAL SUBROUTINES HERE>
*
*
* Sample lines to cut and paste as needed:
*
*
* For CUSTOMER:
*
* READ CUSTOMER.REC FROM CUSTOMER.FILE, CUSTOMER.ID THEN
*
* END ELSE
*
* END
* -----
* READU CUSTOMER.REC FROM CUSTOMER.FILE, CUSTOMER.ID LOCKED
*
* END THEN
*
* END ELSE
*
* END
* -----
* WRITE CUSTOMER.REC ON CUSTOMER.FILE, CUSTOMER.ID
* -----
*
*
* For PRODUCT:
*
* READ PRODUCT.REC FROM PRODUCT.FILE, PRODUCT.ID THEN
*
* END ELSE
*
* END
* -----
* READU PRODUCT.REC FROM PRODUCT.FILE, PRODUCT.ID LOCKED
*
* END THEN
*
* END ELSE
*
* END
* -----
* WRITE PRODUCT.REC ON PRODUCT.FILE, PRODUCT.ID
* -----
*
*
* For :
*
* READ .REC FROM .FILE, .ID THEN
*
* END ELSE
*
* END
* -----
* READU .REC FROM .FILE, .ID LOCKED
*
* END THEN
*
* END ELSE
*
* END
* -----
* WRITE .REC ON .FILE, .ID
* -----
* Skeleton generated by FASTER by Key Ally, Inc. ([EMAIL PROTECTED])
* FASTER is copyright 2007, Charles David Barouch. All Rights Reserved.
END; * Physical End of Program

And here is what mine did:

SUBROUTINE TEST.IT; * Test The Program Generator
*
*    Written by Norman Morgan on July 26, 2007
*
     INCLUDE DMSKELCODE COMMON
*
*    ** Program Constants
     PROG.NAME = "TEST.IT"
     CO.NUM = PARMS(1)<1>
     CO.NAME = PARMS(2)<1>
     AM = CHAR(254); VM = CHAR(253)
     LNNO = 0; PGNO = 0; FIRST = 1; FORM.FEED = CHAR(12)
     LAST.CUST = ""
     LAST.PROD = ""
*    ** Define and initialize total accumulators
*    ** 1st dimension: 1 - Customer, 2 - PRODUCT, 3 - Grand
*    ** 2nd dimension: 1 - X, 2 - X, 3 - X
     DIM TOTALS(3,3)
     MAT TOTALS = 0
*    ** Get non-select runtime parameters
*     REQ.??? = WORK<?>
*    ** Open files
     ERMSG = ""
     OPEN "CUSTOMER" TO F.CUST ELSE ERMSG := "  CUSTOMER"
     OPEN "PRODUCT" TO F.PROD ELSE ERMSG := "  PRODUCT"
     IF ERMSG # "" THEN
        MESG = "Unable to open:":ERMSG
        IF WORK<12,1> # "JS" THEN CALL SB.DISP(3,MESG)
        RETURN
     END
*    ** direct output to printer
     CALL ASSIGN.PRINTER
     MAXLN = PRINT.DEFN<5,2> - 1
*    ** Select records to process with GRI input
     CALL SB.DISP(8,"Selecting CUSTOMER records for ":PROG.NAME)
     VERB = 'SSELECT CUSTOMER WITH'
     WORDS = PARMS(39)
     CALL PARSE.SELECT(WORDS,VERB)
     VERB := ' BY (insert sort criteria here)'
     EXECUTE VERB RETURNING MSG CAPTURING DSP
     IF SYSTEM(11) = 0 THEN
        IF WORK<12,1> # "JS" THEN CALL SB.DISP(3,'No Items Found')
        CALL RESET.PRINTER
        RETURN
     END
*    ** Process selected records
     CALL SB.DISP(8,"Processing CUSTOMER records for ":PROG.NAME)
     SELCNT = SYSTEM(11)
     RECCNT = 0
     END.OF.FILE = 0
     LOOP
        READNEXT CUST.ID ELSE END.OF.FILE = 1
     UNTIL END.OF.FILE = 1 DO
        READ CUST FROM F.CUST,CUST.ID THEN
           GOSUB ProcessRecord
        END
     REPEAT
*    ** do final totals
     GOSUB CustomerTotal
     GOSUB ProductTotal
     GOSUB GrandTotal
*    ** close printer, tidy up and exit
     CALL RESET.PRINTER
     SLEEP 5
     CALL SB.PROCESS("R")
     RETURN
*
ProcessRecord:
*    ** advise user of progress
     RECCNT += 1
     IF (MOD(RECCNT,25) = 0) OR (RECCNT = SELCNT) THEN
        MESSAGE = "Processing record ":RECCNT:" of ":SELCNT
        IF WORK<12,1> # "JS" THEN CALL SB.DISP(9,MESSAGE)
     END
*    ** initialize break registers and do first page headings
     IF FIRST = 1 THEN
        FIRST = 0
*        (initialize break registers here)
        GOSUB PageHeads
        SPOOL.NUM = SYSTEM(20)
        LOG.MSG = "Test The Program Generator"
        CALL LOG.RPT(SPOOL.NUM, LOG.MSG)
     END
*    ** check for control breaks
     IF ???? # LAST. THEN
        GOSUB CustomerTotal
        LAST.CUST = ??CUST??
        GOSUB ProductTotal
        LAST.PROD = ??PROD??
     END
*    (do detail record processing here)
*    ** check for page overflow
     IF LNNO + 1 > MAXLN THEN GOSUB PageHeads
     LNNO += 1
*    (do detail record printing here)
     RETURN
*
CustomerTotal:
     LX = 1
     TEXT = "* Customer Total *"
     GOSUB DumpTotals
     GOSUB ClearTotals
     RETURN
*
ProductTotal:
     LX = 2
     TEXT = "** PRODUCT Total **"
     GOSUB DumpTotals
     GOSUB ClearTotals
     RETURN
*
GrandTotal:
     LX = 3
     TEXT = "*** Grand Total ***"
     GOSUB DumpTotals
     GOSUB ClearTotals
     RETURN
*
DumpTotals:
*    ** check for page overflow
     IF LNNO + 1 > MAXLN THEN GOSUB PageHeads
     LNNO += 1
     RETURN
*
ClearTotals:
     FOR TX = 1 TO 3
        TOTALS(LX,TX) = 0
     NEXT TX
     RETURN
*
PageHeads:
     PGNO += 1
     IF PGNO > 1 THEN PRINT FORM.FEED:
     LNNO = 5
*    ** Heading line 1
*     PRINT "{{ 000000 }} ":
     PRINT CO.NAME"L#30":" ":
     PRINT PROG.NAME"L#30":SPACE(12):
     PRINT "User-ID ":USER.ID"L#3":"   ":
     PRINT TIMEDATE():
     PRINT "  Page: ":PGNO
*    ** Heading line 2
     PRINT "Test The Program Generator"
*    ** Heading line 2a
     IF WORK<26,3> # "" THEN
        PRINT WORK<26,3>"L#130"
        LNNO += 1
     END
*    ** Heading line 2b
     IF WORK<26,4> # "" THEN
        PRINT WORK<26,4>"L#130"
        LNNO += 1
     END
*    ** Heading line 3
     PRINT
*    ** Heading line 4
     PRINT "Column"
*    ** Heading line 5
     PRINT "======"
     RETURN

Of course, mine isn't web based, just an SB+ character mode input screen
for the parameters with some Basic behind it.  Mine also incorporates
some Prelude-specific tools, like David Klendshoj's General Report
Interface and Prelude's standard use of SB+ common fields.  Still, it
save me a lot of work and I wind up using it for everything I write.
Notice that mine assumes the first file named is "primary" and builds
the loop structure to process it, and throws in things like standardized
print and totaling routines.

I hope the group finds your new tool very useful.

===========================================================
Norman Morgan <> [EMAIL PROTECTED] <> http://www.brake.com
===========================================================
Democracy can withstand anything but democrats.
===========================================================

 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Charles Barouch
> Sent: Thursday, July 26, 2007 10:02 AM
> To: [email protected]
> Subject: [U2] I need a favor
> 
> All,
>    I just put up a new (free) tool on my site. It takes very 
> little time to use and I'd appreciate it if some of you would 
> beat on it and let me know what you think.
> 
>    
> http://www.keyally.com/fasterskel/Main.php5
> 
> --
> Charles
> Barouch
> [EMAIL PROTECTED] - Consulting
> (718) 762-3884x1
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to