By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,616 Members | 2,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,616 IT Pros & Developers. It's quick & easy.

Can anyone help me convert VBscript to Javascript

P: 1
I'm trying to convert my VB Script to a Javascript. This is very important to me because VB script is not supported anymore. Please can someone help me?

Expand|Select|Wrap|Line Numbers
  1. <script language=VBSCRIPT> <!--
  2.       function geturl(nRep)
  3.       dim url
  4.       dim sFrom
  5.       dim sTo
  6.       sFrom = year(date()-7) & "-" & right("00" & month(date()-7),2) & "-" & right("00" & day(date()-7),2)
  7.       sTo = year(date()) & "-" & right("00" & month(date()),2) & "-" & right("00" & day(date()),2)
  8.        select case nRep
  9.        case 1
  10.              url = "" & sFrom & "&DateStartEnd_To=" & sTo
  11.        case 2
  12.              url = "URL" & sFrom & "&DateStartEnd_To=" & sTo
  13.        case 3
  14.              url = "URL" & sFrom & "&DateStartEnd_To=" & sTo
  15.        end select
  16.        geturl = url
  17.       end function
  18.      --> </script>
May 17 '16 #1
Share this Question
Share on Google+
1 Reply


Dormilich
Expert Mod 5K+
P: 8,639
can you explain what this script is supposed to do?
May 18 '16 #2

Post your reply

Sign in to post your reply or Sign up for a free account.