Difference in JavaScript vs. VB tools

Need assistance with programming Font Tools? Post here.

Difference in JavaScript vs. VB tools

Postby lkhaas(Legacy Member) on Mon Apr 24, 2006 10:15 am

When using the function code128Auto (passing value '123456789') I get two different results depending on whether I use the JavaScript code or the the Visual Basic code that was downloaded from the Morovia site. Which is correct?
lkhaas(Legacy Member)
 

Re: Difference in JavaScript vs. VB tools

Postby glitch (legacy member) on Mon Apr 24, 2006 12:47 pm

I made a couple of simple tests.

The result for VB code is correct. The Javascript code seems to have a bug which produces the incorrect results encoding odd-lenght numbers.
glitch (legacy member)
 

Re: Difference in JavaScript vs. VB tools

Postby glitch(Legacy Member) on Mon Apr 24, 2006 2:56 pm

glitch(Legacy Member)
 

Re: Difference in JavaScript vs. VB tools

Postby lkhaas(Legacy Member) on Tue Apr 25, 2006 8:39 am

Looks like the code posted in the article has a few problems. Both in the first line to be replaced. I included details in my comments on the article but it was an incorrect parenthesis and using isNumber rather than isNumeric. But with those changes it seems to solve the problem I encountered. Thanks for the speedy response!
lkhaas(Legacy Member)
 

Re: Difference in JavaScript vs. VB tools

Postby glitch(Legacy Member) on Tue Apr 25, 2006 10:04 am

Thanks for pointing out the problem. The function isNumber should be changed to IsNumeric. We have modified the article to reflect the change.

Edited by glitch on April 25 2006 at 10:04am
glitch(Legacy Member)
 


Return to Font Tools API

Who is online

Users browsing this forum: No registered users and 1 guest