Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 15th, 2004, 08:22 PM
Friend of Wrox
 
Join Date: Jul 2004
Location: , , .
Posts: 236
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to differentiate to number lists

I have 2 sets of numbers, one representing Hebrew and the other Greek. How to fix this problem?

Code:
<!--
function getKeyValue(chr) {
  chr=chr.toLowerCase();
  if(chr=="(") return 1;
  if(chr=="b") return 2;
  if(chr=="g") return 3;
  if(chr=="d") return 4;
  if(chr=="h") return 5;
  if(chr=="w") return 6;
  if(chr=="x") return 8;
  if(chr=="+") return 9;
  if(chr=="y") return 10;
  if(chr=="k" || chr=="j") return 20;
  if(chr=="l") return 30;
  if(chr=="m" || chr=="e") return 40;
  if(chr=="n" || chr=="a") return 50;
  if(chr=="s") return 60;
  if(chr==")") return 70;
  if(chr=="p" || chr=="=" || chr=="v") return 80;
  if(chr=="c" || chr=="u") return 90;
  if(chr=="q") return 100;
  if(chr=="r") return 200;
  if(chr=="$" || chr=="%" || chr=="&") return 300;
  if(chr=="t") return 400;
  return 0;
}

function computeValue(str) {
  var ans=0;
  for(var i=0; i<str.length; i++) {
    ans+=getKeyValue(str.charAt(i));
  }
  return ans;
}

function getKeyValue(chr) {
  chr=chr.toLowerCase();
  if(chr=="1") return 1;
  if(chr=="b") return 2;
  if(chr=="g") return 3;
  if(chr=="d") return 4;
  if(chr=="e") return 5;

  if(chr=="h") return 8;
  if(chr=="q") return 9;
  if(chr=="i") return 10;
  if(chr=="k") return 20;
  if(chr=="l") return 30;
  if(chr=="m") return 40;
  if(chr=="n") return 50;
  if(chr=="c") return 60;
  if(chr=="o") return 70;
  if(chr=="p") return 80;
  if(chr=="c") return 90;
  if(chr=="r") return 100;
  if(chr=="s" || chr=="v") return 200;
  if(chr=="t") return 300;
  if(chr=="u") return 400;
  if(chr=="f") return 500;
  if(chr=="x") return 600;
  if(chr=="y") return 700;
  if(chr=="w") return 800;
  return 0;
}

function computeValue(str) {
  var ans=0;
  for(var i=0; i<str.length; i++) {
    ans+=getKeyValue(str.charAt(i));
  }
  return ans;
}
...
Drag and enter a Hebrew word from the <a href="http://www.studylight.org/isb/bible.cgi?query=gen+1%3A1&section=0&it=kjv&ot=bhs&nt=na" target="_blank">Interlinear</a>
<p>



<input type="text" id="hInput">
<input type="button" value="calculate value" onclick="calc('hInput', 'hOutput')">
<input type="text" id="hOutput" readonly="true">

</p>

<p></BDO>
</p>



<input type="text" id="gInput">
<input type="button" value="calculate value" onclick="calc('gInput', 'gOutput')">
<input type="text" id="gOutput" readonly="true">

</p>

<p></BDO>
</p>
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation For Phone Number and Mobile Number dhruthi.ram99 Javascript How-To 12 October 30th, 2011 08:24 AM
Lists rickyoung Pro Visual Basic 2005 0 November 24th, 2006 09:04 AM
How do we differentiate b/w User and Sys tables softwarearchitect SQL Server 2000 5 May 30th, 2004 09:39 AM
Lists Martyn Forum and Wrox.com Feedback 9 June 6th, 2003 12:03 PM
Email Lists Jeff Mason Forum and Wrox.com Feedback 43 June 5th, 2003 12:39 PM



All times are GMT -4. The time now is 05:02 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.