Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
|
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 13th, 2004, 11:37 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default Javascript for an alphanumeric calculator

I want to make an alphanumeric calculator. If you don't know the "Gemetria", the ancient way of calculating was with the alphabet, where a=1,b=2. The tenth letter and on would be 2 digits (10,20...). 19th letter and on would be 3 digits (100, 200...). So I want to paste words and submit and the value of the word would show. The values of the Hebrew Alphabet are the following:

Quote:
quote:

every other key must be 0

)=1
B=2
g=3
d=4
h=5
w=6
x=8
+=9
y=10
k and j=20
l=30
m and e=40
n and a=50
s=60
(=70
p and =80
c and u=90
q=100
r=200
#=300
t=400
I put some things together but couldn't figure out entirely. The Js section is from a calculator with buttons, and has #1-9. I was wondering if that can be used or to be changed entirely.

This is what I have so far:
Code:
<HTML>
<HEAD>
<TITLE><%= pageTitle %></TITLE>
<script type="text/javascript">
<!--
    Dim operator, buffer, operation

function Process(){
  var frm = document.getElementById("form1");
  var x = Number(frm.t1.value);
  var  = (x +);
  alert("( " + x + " ) = ") 
}

    Sub one_onclick
    if display.value="0" Then display.value=""
    if operation=1 Then display.value="1"
    if operation=0 Then display.value=display.value+"1"
    operation=0
    End Sub
    Sub two_onclick
    if display.value="0" Then display.value=""
    if operation=1 Then display.value="2"
    if operation=0 Then display.value=display.value+"2"
    operation=0
    End Sub
    Sub three_onclick
    if display.value="0" Then display.value=""
    if operation=1 Then display.value="3"
    if operation=0 Then display.value=display.value+"3"
    operation=0
    End Sub
    Sub four_onclick
    if display.value="0" Then display.value=""
    if operation=1 Then display.value="4"
    if operation=0 Then display.value=display.value+"4"
    operation=0
    End Sub
    Sub five_onclick
    if display.value="0" Then display.value=""
    if operation=1 Then display.value="5"
    if operation=0 Then display.value=display.value+"5"
    operation=0
    End Sub
    Sub six_onclick
    if display.value="0" Then display.value=""
    if operation=1 Then display.value="6"
    if operation=0 Then display.value=display.value+"6"
    operation=0
    End Sub
    Sub seven_onclick
    if display.value="0" Then display.value=""
    if operation=1 Then display.value="7"
    if operation=0 Then display.value=display.value+"7"
    operation=0
    End Sub
    Sub eight_onclick
    if display.value="0" Then display.value=""
    if operation=1 Then display.value="8"
    if operation=0 Then display.value=display.value+"8"
    operation=0
    End Sub
    Sub nine_onclick
    if display.value="0" Then display.value=""
    if operation=1 Then display.value="9"
    if operation=0 Then display.value=display.value+"9"
    operation=0
    End Sub    

    Sub plus_onclick
    determine()
    operator="plus"
    operation=1
    End Sub

</script>
</HEAD>
<body class="body">

<form id="form1" action="" onsubmit="">
Enter a word to determine the numerical value:
    <input type="text" name="t1"/>
    <input type="button" value="Gemetria" onclick="Process()"/>
</form>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Regex and Alphanumeric matching? quantass BOOK: Beginning Regular Expressions 0 March 10th, 2007 11:34 AM
Format a string of alphanumeric characteres hugoscp XML 8 September 21st, 2006 06:07 AM
Generation of alphanumeric random characters sajid_pk ASP.NET 1.0 and 1.1 Professional 1 May 10th, 2005 08:37 AM
Number and letters (alphanumeric values) jorluiseptor Classic ASP XML 0 April 22nd, 2005 03:07 PM
Javascript Calculator - Help! dedbob Javascript 1 November 16th, 2003 11:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.