Calculator

By Korvin on Jun 14, 2008

i made this in about 10 mins xD its just bcuz i wanted to try out Dialog Studio, and honestly i love it, it was great!

i really recommend it!

http://www.webgeekworld.com/downloads/dstudio.zip

dialog calcy {
  title "Calculator"
  size -1 -1 66 93
  option dbu
  button "7", 7, 2 16 14 14, flat
  button "8", 8, 17 16 14 14, flat
  button "9", 9, 32 16 14 14, flat
  button "1", 1, 2 46 14 14, flat
  button "4", 4, 2 31 14 14, flat
  button "5", 5, 17 31 14 14, flat
  button "6", 6, 32 31 14 14, flat
  button "2", 2, 17 46 14 14, flat
  button "3", 3, 32 46 14 14, flat
  button ".", 10, 2 61 14 14, flat
  button "0", 11, 17 61 14 14, flat
  button "=", 12, 32 61 14 14, flat
  button "+", 13, 50 16 14 14
  button "-", 14, 50 31 14 14
  button "*", 15, 50 46 14 14
  button "/", 16, 50 61 14 14
  ;button "+/-", 17, 2 77 14 14
  button "^", 18, 50 77 14 14
  button "C", 19, 50 1 14 14, flat
  edit "", 20, 2 2 48 12
  button "x²", 21, 32 77 14 14
  button "x³", 22, 17 77 14 14
}
on *:dialog:calcy:*:*: {
  if ($devent == sclick) {
    if ($did isnum 1-9) { did -a $dname 20 $did }
    if ($did == 11) { did -a $dname 20 0 }
    if ($did == 10) && (. !isin %stf) { did -a $dname 20 . }
    if ($did == 19) { did -r $dname 20 }
    if ($did == 12) { var %ee = $calc($did($dname,20)) | did -r $dname 20 | $iif($len(%ee) > 14,echo -a The Answer Is,did -a $dname 20) %ee }
    if ($did == 13) { did -a $dname 20 + }
    if ($did == 14) { did -a $dname 20 - }
    if ($did == 15) { did -a $dname 20 * }
    if ($did == 16) { did -a $dname 20 / }
    if ($did == 18) { did -a $dname 20 ^ }
    if ($did == 21) { var %ee $calc($did($dname,20) ^ 2) | did -r $dname 20 | did -a $dname 20 %ee }
    if ($did == 22) { var %ee $calc($did($dname,20) ^ 3) | did -r $dname 20 | did -a $dname 20 %ee }
  }
}

Comments

Sign in to comment.
Jonesy44   -  Jun 15, 2008

You\'ve commented a line which should be uncommented ..

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.