mIRC Home    About    Download    Register    News    Help

Print Thread
#118191 23/04/05 12:51 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I'm looking for a way to get a nice, neat formatted output for something like a bank book.
The display would have the following headings at the top:
Tr# Date Time Details Amount Balance

Tr# would be a 3 digit transaction number
Date would be the date of the transaction in DD-MMM-YYYY format
Time would be the time of the transaction in HH:MM:SS AM/PM format
Details would be Deposit, Withdraw, Bal. Fwd., Interest, or any one of a number of other things
Amount would be the amount added to or taken from the account in normal currency format, with the $ left justified in the column and the amount right justified....maximum 13 characters
Balance would be the current balance up to and including that transaction. maximum 16 characters.

the information is stored in a hash table, and I'd like the hash table to update (ie: get rid of the old information) when the person calls for a bank book update.

Hope someone can help me with this, as it's driving me bonkers. I already have some coding that I think will help, but not sure. The coding follows
Code:
 alias charpad {
  return $iif($len($1) < $int($2), $+($str($left($$3,1),$calc($int($2) - $ifmatch)),$1), $1)
} 
alias decim {
  tokenize 46 $$2. $1
  return $+($2.,$3,$str(0,$calc($1 -$len($3))))
}
 

#118192 23/04/05 04:54 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Try this:

Code:
; -------------------------------------------------------------------------------------------------
; New padding elements
; --
; Here is another padding alias that allows you to specifiy another character other than the hard
; space (chr 160) for a padding element.
;
; SYNTAX:
;   $pad(string, width [, align [, char(int)]])
;   align is assumed left if unspecified, otherwise use left,right,center
;
; exaple:
;   /echo -a $pad(Name, 16, center) $pad(Mail, 32, center) $pad(url, 50, center)
;   /echo -a $pad(KingTomato, 16) $pad(kingtomato@kingtomato.com, 32) $pad(www.kingtomato.com, 50)
; -------------------------------------------------------------------------------------------------
/pad {
  var %chr = $iif($4, $chr($4), $chr(160))

  if ($2 <= $len($1)) return $1
  if ($3 == right) return $+($str(%chr,$calc($2 - $len($1))), $1)
  else if ($3 == center) {
    var %left = $int($calc(($2 - $len($1)) / 2))
    return $+($str(%chr,%left), $1, $str(%chr,$calc(($2 - $len($1)) - %left)))
  }
  return $+($1, $str(%chr,$calc($2 - $len($1))))
}
; by KingTomato

[Copy to wordpad first, then copy and paste from wordpad to mIRC]


-KingTomato

Link Copied to Clipboard