lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to do this?


From: Edward S. Hirgelt
Subject: How to do this?
Date: Thu, 23 Apr 1998 11:26:19 -0700

What I want to do is set up a function that allows me to enter an
arbitrary number of ``rows'' of data and build a table out of it (just
like @Tab).  In fact, I want to use @Tab within it.  The goal is to
build a time sheet without having to use the mechanics of @Tab.

The enclosed files show my attempt at this.  It doesn't work
unfortunately.  If I don't refer to @Rowa in the @DoHr and @DoTo
definitions, I do get output, but it isn't formated properly.

I've tried variations on everything. At first I didn't have the @Do*
definitions, but invoked them directly within the body of the
function.  That didn't work any differently.  I went to the macro
version after looking at @Tab (perhaps not carefully enough).

So, what am I missing (short of rewriting @Tab or including most of it
here)?

I've enclosed two files, log.lout that tests this and mydefs.  Any
comments or suggetions greatly appreciated.

Thanks,
Ed
----------------------------------------------------------------------
 Edward S. Hirgelt             "Education is the ability to listen to
 TIBCO Inc.                     almost anything without losing your 
                                temper or your self-confidence."
 Palo Alto, Ca                                  --Robert Frost
 address@hidden
 address@hidden   415 846 5034
----------------------------------------------------------------------

@SysInclude{tab}
@SysInclude{doc}
@Document
//
@Text @Begin

@LP
The intent of the "@HourLog" definition is to allow me to enter
a set of time ranges and build up a table of hours worked.
The model for this is "@Tab" itself which is used internally.
@LP
The unfortunate output is nothing for the hour log.
I tried it both with the macro indirection in the definition as
it now stands and without.  The results are the same.
@DP
@HourLog
{
        @Hr st{10:15} fin{13:15} tot{3^.0}
        @Hr st{13:15} fin{14:15} tot{1^.0}
        @Hr st{15:00} fin{18:00} tot{3^.0}
        @To {7^0}
}
@LP
End of test
@End @Text
export @Hr @To

def @HourLog
        body @theHours
{
        import @Tab
        def @DoHr named st {}
                     named fin {}
                     named tot {}
        {
                @Rowa A{st^--fin} B{tot}
                #st, fin, tot
        }
        
        import @Tab
        def @DoTo right total
        {
                @Rowa A{To^tal} B{total}
                #Total is total
        }
        
        macro @Hr { / @DoHr }
        macro @To { / @DoTo }
        
        @Center @Tab
                between{yes} above{yes} below{yes} side{yes}
                @Fmta { @Col A ! @Col B }
        {
                @theHours
        }
}


reply via email to

[Prev in Thread] Current Thread [Next in Thread]