mIRC Home    About    Download    Register    News    Help

Print Thread
#15663 16/03/03 09:12 PM
Joined: Dec 2002
Posts: 68
P
Babel fish
OP Offline
Babel fish
P
Joined: Dec 2002
Posts: 68
I am making my own calculator for a script. Here is what I have:

Code:
dialog lcalc {
  title "calc"
  size -1 -1 123 130
  option dbu
  edit "", 1, 0 2 120 28, multi return
  button "7", 2, 7 31 18 20
  button "8", 3, 28 31 18 20
  button "9", 4, 49 31 18 20
  button "/", 5, 70 31 18 20
  button "=", 6, 91 103 18 20
  button "4", 7, 7 55 18 20
  button "5", 8, 28 55 18 20
  button "6", 9, 49 55 18 20
  button "*", 10, 70 55 18 20
  button "-", 11, 70 79 18 20
  button "3", 12, 49 79 18 20
  button "2", 13, 28 79 18 20
  button "1", 14, 7 79 18 20
  button "+", 15, 70 103 18 20
  button ".", 16, 49 103 18 20
  button "-/+", 17, 28 103 18 20
  button "0", 18, 7 103 18 20
  button "Mod", 19, 91 79 18 20
  button "^", 20, 91 55 18 20
  button "Clear", 21, 91 31 18 20
}
on 1:dialog:lcalc:sclick:*:{ 
  if ($did == 10) { did -a lcalc 1 * | set %cs %cs $+ * }
  elseif ($did == 11) { did -a lcalc 1 - | set %cs %cs $+ - }
  elseif ($did == 15) { did -a lcalc 1 + | set %cs %cs $+ + }
  elseif ($did == 5) { did -a lcalc 1 / | set %cs %cs $+ / }
  elseif ($did == 6) { did -i lcalc 1 2 $calc($did(lcalc,1,1)) }
  elseif ($did == 21) { unset %cs | did -r lcalc 1 }
}


(Note: I have more stuff in there, those are just the things that I'm having problems with).

When I press the equals button (did 6), it does not display anything on the second line like I want it to. I want it to display the answer. Please help!

Joined: Dec 2002
Posts: 212
V
Fjord artisan
Offline
Fjord artisan
V
Joined: Dec 2002
Posts: 212
editboxes don't have second line smile
use listbox/combo instead


And all I need now is intellectual intercourse, a soul to dig the hole much deeper
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Quote:
editboxes don't have second line

They do when you use the "multi" style.

Joined: Jan 2003
Posts: 44
L
Ameglian cow
Offline
Ameglian cow
L
Joined: Jan 2003
Posts: 44
heh, did you look at my calculator i posted in this group?

most of the work has already been done and there might be a clue in there for you too.


Link Copied to Clipboard