Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript 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 February 12th, 2011, 04:04 PM
Registered User
 
Join Date: Feb 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Javascript Question

I found a web site that converts Excel worksheet to HTML.

First, I wanted to know if this code is javascript:

var c1C21=(((var_ls((c1C19),(5)))?(((v2n(c1C19))+(5))) :(((v2n(c1C19))-(5)))));

Second, is their a way to convert the above line to an Excel formula?

What does the var_ls and v2n represent in the above line?

Thanks
Reply With Quote
  #2 (permalink)  
Old February 12th, 2011, 06:01 PM
Imar's Avatar
Wrox Author
Points: 71,804, Level: 100
Points: 71,804, Level: 100 Points: 71,804, Level: 100 Points: 71,804, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,044
Thanks: 80
Thanked 1,580 Times in 1,557 Posts
Default

Hi there,

Pretty hard to tell by this code alone. You can simplify it to this:

var c1C21 = var_ls(c1C19, 5) ? v2n(c1C19) + 5 : v2n(c1C19) - 5;

This says something like:

If var_ls(c1C19, 5) is null, then take v2n(c1C19) - 5, otherwise, take v2n(c1C19) + 5

I can only assume that var_ls and v2n are functions defined somewhere in your HTML page or JavaScript file.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #3 (permalink)  
Old February 12th, 2011, 06:16 PM
Registered User
 
Join Date: Feb 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thanks again for your help

Thanks for your reply!!

The code was taken from a web page source code.

The code was generated by a program using spreadsheet converter.

I was curious to know what the Excel formula was that was translated to javascript.

If you have any suggestion.

Thanks
Reply With Quote
  #4 (permalink)  
Old February 12th, 2011, 06:21 PM
Imar's Avatar
Wrox Author
Points: 71,804, Level: 100
Points: 71,804, Level: 100 Points: 71,804, Level: 100 Points: 71,804, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,044
Thanks: 80
Thanked 1,580 Times in 1,557 Posts
Default

Again, hard to tell without seeing the code or original spread sheet. It might have been something like this:

=IF(ISBLANK(B7), B8 - 5, B9 - 5)

Cheers.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #5 (permalink)  
Old February 12th, 2011, 06:40 PM
Registered User
 
Join Date: Feb 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Possibility

Maybe the Excel formula may be:

var c1C21=(((var_ls((c1C19),(5)))?(((v2n(c1C19))+(5))) :(((v2n(c1C19))-(5)))));

var_ls might be the equivalent to MOD?

Not sure what v2n may be

Possible formula ==IF($C$19<5,$C$19+5,$C$19-5)
Reply With Quote
  #6 (permalink)  
Old February 12th, 2011, 07:05 PM
Registered User
 
Join Date: Feb 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thanks for your help

Thanks again!!
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
Javascript question on reset and onfocus gilgalbiblewheel Javascript How-To 1 March 10th, 2005 10:50 AM
javascript onclick question robs Javascript 1 January 19th, 2005 05:20 AM
Javascript printing question? macupryk General .NET 0 October 31st, 2004 12:28 AM
Javascript question in my ASP code savoym Classic ASP Basics 3 May 24th, 2004 07:05 PM
question about Javascript capabilities DWoods57 Javascript How-To 1 December 18th, 2003 07:29 AM



All times are GMT -4. The time now is 06:29 PM.


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