VBScript to JScript need help

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 12 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
index_999
Posts: 14
Last visit: Thu Jan 17, 2013 6:50 pm

VBScript to JScript need help

Post by index_999 »

dear friends.help me please to translate this code VBScript to JScriptDim Syste,Form,Button Set System = CreateObject( "Kixtart.System" ) Set Form= System.FormSet Button = Form.Button Button.Center Button.Text = "Click Me" Button.OnClick = "Button_Click" Form.Center Form.Show While Form.Visible Execute Form.DoEvents WEnd Function Button_Click MsgBox "Hi hows it going?" End Function


index_9992011-03-03 11:54:38
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

VBScript to JScript need help

Post by jvierra »

This is NOT vbscript. It is VB.NET Forms scripting. It cannot be converted into jscript.

User avatar
index_999
Posts: 14
Last visit: Thu Jan 17, 2013 6:50 pm

VBScript to JScript need help

Post by index_999 »

thanks for answer, but i dont't think so. You can try it on your computer with kixforms.dllnow i have some JScode code too, but it's not work true://-------------------------------------------var system = new ActiveXObject("Kixtart.System");form = system.Form();form.Text = "Test Events";form.Width = 400;form.Height = 300;var button1 = form.Controls.Add("Button");button1.Text = "button1";button1.Top=100;button1.Left=100;button1.OnClick =button_Click1;var button2 = form.Controls.Add("Button");button2.Text = "button2";button2.Top=100;button2.Left=200;button2.OnClick =button_Click2;function button_Click1(){WScript.Echo("Button1 Click Event"); };function button_Click2(){WScript.Echo("Button2 Click Event"); };form.Center();form.Show();while (form.Visible){button_Click1.call(form.DoEvents()); }
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

VBScript to JScript need help

Post by jvierra »

You are talking abpouot KixStart. I would try posting in a KixStart forum.

You can manually convert the VBS to JS wqhich is not hard but the KixStart stuff is custom to that vendor.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

VBScript to JScript need help

Post by jvierra »

I don't understand.

You say it doesn't work BUT it works for button_Click1. What is it that doesn't work?

Execute is a Kisxstart method. I would assume:form.DoEvents(); would be the correct syntax however DoEvents is a VB primitive. Does KixStart use different modules for VBS and JS?


jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

VBScript to JScript need help

Post by jvierra »

#1. I do't think you understand forms or programming forms.
#2. YOu would get better and more to teh point help on KixStart forum as none of this has anything to so with JScript of VBScript.

Execute is VBS syntax that executes a block of code. The coed I posted is similar for JScript. If it soesn't work then it is likely a KixStart issue.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

VBScript to JScript need help

Post by jvierra »

It has nothing to do with ECMA. ECMA is a web standard and not an admin scripting stndard. ECMA also has nothing to do with KixStart. KixStart is a vendor proprietary product.

Yuo really need to go to a KixStart forum. In many years we have never had a KixStart issue here. KicStart is seldom used in Admin scripting.

Maybe, if you are lucky, someone who uses KixStart might be watching this forum.

You really need to understand that DoEvents is a VB function/method. It has little to do with JScript.

Neither VBScript not JScript have an ability to manage events except with certain COM classes that follow a very specific protocol. People who use KixStart regularly would have a better sense of how to over come this issue.

My suspicion is that yo are mixing many differnt bits you have copied off of the Internet without much understaanding of any of them. THis will make it much harder for you to understand where to get an answer or what exact question to ask.

Start with a KixStart foum. I believe that it wil lget you closer to an answer much faster.

jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

VBScript to JScript need help

Post by jvierra »

ECMA is a standard that is based on both VBScript and JScript. It is a subsret although almost complete. ActiveX is not part of ECMA. AtiveX is a Microsoft technology based on COM. MS is phasing out ActiveX and COM.
User avatar
index_999
Posts: 14
Last visit: Thu Jan 17, 2013 6:50 pm

VBScript to JScript need help

Post by index_999 »

do you know about Microsoft's plans to phasing out ActiveX technology? ;) it's great. and what will be with OCX and DLL?from 5, 10, 15 years or tomorrow?

User avatar
index_999
Posts: 14
Last visit: Thu Jan 17, 2013 6:50 pm

VBScript to JScript need help

Post by index_999 »

This topic is 12 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked