Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VBScript Javascript
So there is a textbox with 10 words in it. I am trying to find how many words in the string named ta_val. I already did the javascript but need help in vbscript.
 
ta_val=document.tb.ta.value;
len_ta=ta_val.length;
 
var sArray = ta_val.split("");
var sLength = sArray.length;
a.innerHTML = sLength;
 

 
I tried this and it did not work.
dim sArray = split(ta_val,"")
dim sLength = len("sArray")
a.innerHTML = sLength
 
Is there some place to convert javascript to vbscript? Like a program?
Posted 1-May-11 10:21am
uchihaa108
Edited 1-May-11 10:22am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Why would you do this? Javascript is a standard language, VBScript is proprietary.
 
Look at the ECMA standards on the topic:
http://en.wikipedia.org/wiki/ECMAScript[^].
 
This is what Javascript is — an implementation of the ECMAScript:
http://en.wikipedia.org/wiki/JavaScript[^].
 
This is what VBScript is:
http://en.wikipedia.org/wiki/VBScript[^].
 
All you can do with VBScript you can do with Javascript, not the other way around.
If you need to preserve you work and make it compatible, forget VBScript and use Javascript in all cases.
 
Yes, I know I don't answer your question. You don't need an answer, you need help.
 
[EDIT]
 
You will take less time in just learning VBScript than searching for the tool.
By reasons I explained, there are translators from VBScript to Javascript, but I never heard of the opposite.
 
See:
http://stackoverflow.com/questions/569380/how-can-i-convert-javascript-to-vbscript[^]:
 
"You can convert VB to JS but JS to VB… that's just crazy talk."

 
Do the Google search if you want…
 
—SA
  Permalink  
v2
Comments
uchihaa at 1-May-11 15:39pm
   
It is for homework, I need to be able to do assignments both ways. Javascript seems to be easier so I am able to do it but not vbscript.
SAKryukov at 1-May-11 15:46pm
   
If this is homework -- quit you school. What can you learn from people giving you such assignments?
 
OK, read my update...
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 George Jonsson 215
1 Kornfeld Eliyahu Peter 169
2 Zoltán Zörgő 139
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,342


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 1 May 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100