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 15th, 2004, 07:22 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
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>





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 07: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 08:39 AM
Lists Martyn Forum and Wrox.com Feedback 9 June 6th, 2003 11:03 AM
Email Lists Jeff Mason Forum and Wrox.com Feedback 43 June 5th, 2003 11:39 AM





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