[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: [sqr-users] Having trouble with negative line positioning



Matt,

Use this:
  let #num_in_type = #num_in_type * -1
  position (+#num_in_type)

Also, you may be interested in the KEEP-TOP modifier for PRINT WRAP.

Ray

  
On Tue, Jan 13, 2004 at 05:38:28PM -0500, Matt Rogish wrote:
> Hi all,
> 
> I have a list of donations with attached user name records that I'm 
> grabbing in one query, so the output looks like:
> $123,555  Matt  Cash
> $12,000,000 Bob  Cash
> $12,000 Joe  Credit Card
> $14,000 Happy  Credit Card
> $15,000 Gilmore Credit Card
> etc.
> *Note the order by is type (cash, credit card, etc.) and then dollar amount.
> 
> What I'd like to do is add the multi-line (it's from a DBMS table) 
> description of the type to the output in a third column.  So my sample 
> output would look something like:
> $123,555  Matt  Cash      Cash is usually collected on Fridays
> $12,000,000 Bob  Cash    and is delivered to the bank in an
>                                     armored car.  Note that the driver is 
> armed with a bazooka,
>                                     so attempting a robbery would be 
> ill-advised.
> $12,000 Joe Credit Card      Credit Card payments are handled instantly
> $14,000 Happy Credit Card   via our supplier.
> $15,000 Gilmore Credit Card
> 
> I was thinking I could do something like this:
> 
> let #num_in_type = 0
> 
> begin-select
> dollar_amount
> name
> type on-break print=never after=get_type_description
> 
>   add 1 to #num_in_type
> 
> from foo
> ...
> end-select
> 
> procedure get_type_description
> 
>    position (-#num_in_type )
>    let #num_in_type = 0
> 
> end-procedure
> 
> There are two things wrong with this.  First off, I can't use negative 
> positioning with any sort of a variable.  If I use position (-#num_in_type) 
> I get:
> (SQR 4501) Use '+' and negate variable for reverse relative placement.
> -#num_in_type
> 
> Ok, so I changed it to be:
> let #num_in_type = #num_in_type * -1
> position (#num_in_type)
> 
> Which, unsurprisingly, does not work either:
> (SQR 4503) Fixed line placement #num_in_type must be > 0.  Use relative 
> positioning, (+#line,10,0).
> 
> Is there no way to dynamically use position with a negative variable?  I 
> can do position (-1) just fine!
> 
> Secondly, if the description for 'cash' is more rows than the number of 
> cash items, then it bleeds into the description for credit card, so I'd 
> need a way to create whitespace in between cash and credit card as shown in 
> the example.  I can't seem to make this work.  Any ideas!?
> 
> 
> Thanks,
> 
> --
> Matt Rogish - rogishmn@muohio.edu
> Programmer
> Advancement Services
> Miami University
> 513.529.1420
> 
> Do not meddle in the affairs of SQR,
> for it is subtle and quick to anger!  
> 
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org
> http://www.sqrug.org/mailman/listinfo/sqr-users
----------------------------------------------------------------------
Ray Ontko   rayo@ontko.com   Phone 1.765.935.4283   Fax 1.765.962.9788
Ray Ontko & Co.   Software Consulting Services   http://www.ontko.com/

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users