Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.

MIDL
ta_val=document.tb.ta.value;
len_ta=ta_val.length;


C#
var sArray = ta_val.split("");
var sLength = sArray.length;
a.innerHTML = sLength;




I tried this and it did not work.
VB
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
Updated 1-May-11 9:22am
v2

1 solution

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
 
Share this answer
 
v2
Comments
uchihaa 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.
Sergey Alexandrovich Kryukov 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900