| T.R | Title | User | Personal Name
 | Date | Lines | 
|---|
| 4160.1 |  | SAUTER::SAUTER | John Sauter | Fri Sep 28 1990 14:39 | 7 | 
|  |     My memory is vague, but I seem to recall that the manual is inaccurate
    or incomplete about these functions.  I think TODAY takes a parameter
    (which it ignores) and the argument of SUM must be declared in a GROUP.
    
    Sorry to be so uncertain, but I solved these two problems quite a while
    ago, and I don't remember the solutions for certain.
        John Sauter
 | 
| 4160.2 | It mustn't be today?? | BELFST::MCCLINTOCK | Peter | Fri Sep 28 1990 18:43 | 13 | 
|  |     Thanks for the suggestions.  I've tried giving today an argument,
    perhaps you could try it for me??
    
    Using the Command option: Amiga/A try to execute
    
    	?TODAY
    or	?TODAY()
    	etc.
    
    Let me know if you can get anything to work.  I appreciate the help
    .. this is getting a bit frustrating.
    
    Peter 
 | 
| 4160.3 | SUM success. | BELFST::MCCLINTOCK | Peter | Fri Sep 28 1990 18:58 | 12 | 
|  |     John,
    
    You are right about the SUM function.  Declaring the field to be
    totalled in the GROUP statement fixes it.
          
    Strange though that when the program is generated with the Forms
    editor it doesn't do this.  I am only able to do it by editing the
    program before running it.   Is there a way that you know of to
    declare the field in the Group statement when generating the report
    from the Forms Ed.
          
    Peter      
 | 
| 4160.4 | examples | SAUTER::SAUTER | John Sauter | Mon Oct 01 1990 07:33 | 92 | 
|  |     I don't read notes much from home, so I didn't see your request to try
    the TODAY function.  I did, however, upload a couple of programs I have
    been using for a while.  It appears that my memory of the TODAY
    function was incorrect.  I hope these two examples are helpful.
    
    I don't use the form editor except to create appearances, so I don't
    know about creating programs from the forms editor.
        John Sauter
    ============================================================================
 OPEN FILE "categories"
 OPEN FILE "checkbook"
 
 REPORT amount.checkbook
 AFTER REPORT 
 ? 
 ? "This week's expenses total ", SUM (amount.checkbook)
 END REPORT 
 
 FOOTING 2
 ? 
 ? BF OFF ; IT OFF ; UL OFF ;"Weekly Expenses "; TODAY ;" "; NOW ;" page "; STR$ ( PG ,"z99")
 END FOOTING 
 
 GROUP category.checkbook,amount.checkbook,check_no.checkbook
 BEFORE GROUP category.checkbook
 EJECT 5
 ? 
 ? BF OFF ; IT OFF ; UL OFF ;" Category ";category_name.categories;"                          ";category.checkbook
 END GROUP 
 
 AFTER GROUP category.checkbook
 IF COUNT > 1 THEN ? BF OFF ; IT OFF ; UL OFF ;@48;"subtotal is "; SUM (amount.checkbook)
 END GROUP 
 
 SELECT BF OFF ; IT OFF ; UL OFF ;
 LEFT$ (party,49);@50check_no.checkbook;split.checkbook;" ";amount.checkbook
 WHERE category.checkbook = category_no.categories AND category.checkbook > 0 AND (date_budgeted.checkbook = DAYS ("31-Dec-9999"))
 ORDER category.checkbook,check_no.checkbook,split.checkbook,date_written.checkbook,date_entered.checkbook,time_entered.checkbook
 TO PRINTER 
  QUIT 
    
    ============================================================================
 OPEN FORM "transfer"
 FILE "checkbook"
 INDEX "check_no"
 
 ON ERROR GOTO goterror
nexttransfer: 
 FORM 1
 BLANK 
 LET category_name.checkbook = " "
 LET date_returned.checkbook = TODAY 
 LET check_no.checkbook = 0
 LET split.checkbook = "@"
 LET date_written.checkbook = TODAY 
 ENTER category.checkbook
 ENTER amount.checkbook
 ENTER party.checkbook
timeagain1: 
 LET date_entered.checkbook = TODAY 
 LET time_entered.checkbook = NOW 
 IF date_entered.checkbook <> TODAY THEN GOTO timeagain1 END IF 
 LET date_budgeted.checkbook = "31-Dec-9999"
 LET was_budgeted.checkbook = "S"
 LET amount.checkbook = - amount.checkbook
 STORE 
 BLANK DUPLICATE 
 FORM 2
 LET category.checkbook = 0
 LET amount.checkbook = - amount.checkbook
 ENTER category.checkbook
timeagain2: 
 LET date_entered.checkbook = TODAY 
 IF time_entered.checkbook = NOW THEN GOTO timeagain2 END IF 
 LET time_entered.checkbook = NOW 
 IF date_entered.checkbook <> TODAY THEN GOTO timeagain_2 END IF 
 STORE 
 GOTO nexttransfer
goterror: 
 SELECT LAST 
 SET RECORD ON 
 VIEW 
 END 
    
 | 
| 4160.5 | Must be me?? | BELFST::MCCLINTOCK | Peter | Mon Oct 01 1990 14:31 | 23 | 
|  |     John,
    
    I clearly have a Superbase or environment problem here.  I have
    tried executing pieces of your code (extracted from the note) to
    make sure that I am not making any stupid syntax errors.
    
    When the system finds a line with TODAY or NOW in it I get:
    
    Can't do this... 
    TODAY
    Misplaced command
    
    or 
    
    Can't do this... 
    NOW
    Misplaced command
       
    I'll try calling Precision Software and reporting the problem to
    them.  I'll post the outcome here.
    
    Thanks
    Peter 
 | 
| 4160.6 |  | SAUTER::SAUTER | John Sauter | Mon Oct 01 1990 15:28 | 8 | 
|  |     When you call, be sure to mention your version number.  I sent for the
    non-protected copy, and got version 3.02.
    
    The text I posted was generated using the SAVE TEXT feature.  There
    appears to be a bug in this feature: it inserts carriage return
    characters at end of line.  I suspect it is a port from an MS-DOS
    machine.
        John Sauter
 | 
| 4160.7 | RETURN=OFF | BELFST::MCCLINTOCK | Peter | Tue Oct 02 1990 04:26 | 10 | 
|  | >    The text I posted was generated using the SAVE TEXT feature.  There
>    appears to be a bug in this feature: it inserts carriage return
>    characters at end of line.  I suspect it is a port from an MS-DOS
>    machine.
    You can change this by putting RETURN=OFF in the tool types of the
    Superbase or Program icon.
    
    Peter
 | 
| 4160.8 |  | SAUTER::SAUTER | John Sauter | Tue Oct 02 1990 06:25 | 4 | 
|  |     re: .7
    
    Thanks.  I don't recall seeing that anywhere in the documentation.
        John Sauter
 | 
| 4160.9 | Problem Solved | BELFST::MCCLINTOCK | Peter | Wed Oct 03 1990 04:42 | 6 | 
|  |     The copy of SBPRO on my hard disk must have been corrupted somehow.
    Copying a fresh version from the distribution solved the problem.
    
    I should have thought of this earlier.  Thanks for the help.
    
    Peter
 |