473,406 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Command Line Args from Compiled Javascript

Hello All,

I have a large WSH Javascript script that I want to convert to .Net
Javascript.

How do I accomplish the same functionality as - var args =
WScript.Arguments; within the .Net Framework.

One would think that the System.Console class would handle this, but
it doesn't.

Is there something like C#'s public static void Main( string[] args )
{ } available.

Does Javascript even have a "main"?

Thanks,
Norman
Jul 21 '05 #1
2 2806
Not sure how JScript.NET implements it's entrypoint function. However, you
can use System.Environment.GetCommandLineArgs().

-mike
MVP
"Norman" <ni********@hotmail.com> wrote in message
news:5d**************************@posting.google.c om...
Hello All,

I have a large WSH Javascript script that I want to convert to .Net
Javascript.

How do I accomplish the same functionality as - var args =
WScript.Arguments; within the .Net Framework.

One would think that the System.Console class would handle this, but
it doesn't.

Is there something like C#'s public static void Main( string[] args )
{ } available.

Does Javascript even have a "main"?

Thanks,
Norman

Jul 21 '05 #2
ni********@hotmail.com (Norman) wrote in
news:5d**************************@posting.google.c om:
Hello All,

I have a large WSH Javascript script that I want to convert to
.Net Javascript.

How do I accomplish the same functionality as - var args =
WScript.Arguments; within the .Net Framework.

One would think that the System.Console class would handle this,
but it doesn't.
Norman,

Here's a silly program I wrote in JScript.Net that shows one way to
get the command line arguments:

http://99-bottles-of-beer.ls-la.net/j.html#JScript/NET
Is there something like C#'s public static void Main( string[]
args ) { } available.

Does Javascript even have a "main"?


Not that I know of. Execution begins with the first line of code in
the first .js file specified on the compiler's command line.

Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Manlio Perillo | last post by:
Regards. In the standard library there are two modules for command line parsing: optparse and getopt. In the Python Cookbook there is another simple method for parsing, using a docstring. ...
0
by: andrea valle | last post by:
Hi to all, I need to run a program from inside python (substantially, algorithmic batch processing). I'm on mac osx 10.3.8 with python 2.3 framework and macpython. Trying to use exec*, I...
2
by: paul | last post by:
I have a file type that is going to be associated with my visual basic application and i want the user to be able to double click on a file of said type and have it launch the program and load the...
2
by: Norman | last post by:
Hello All, I have a large WSH Javascript script that I want to convert to .Net Javascript. How do I accomplish the same functionality as - var args = WScript.Arguments; within the .Net...
8
by: djc | last post by:
I'm new to this and was wondering what the options are for interpreting the command line using a CLI program. Specifically methods for interpreting the parameters passed to the program on the...
4
by: comp.lang.php | last post by:
I am trying to simply pipe in 2 very small commands and not have to create a PHP script to do this: However, I do not have the "-r" option in PHP 4.3.9, and I would think that I would, but...
4
by: cjt22 | last post by:
Hi there. I just wondered whether anyone could recommend the correct way I should be passing command line parameters into my program. I am currently using the following code: def main(argv =...
51
by: Ojas | last post by:
Hi!, I just out of curiosity want to know how top detect the client side application under which the script is getting run. I mean to ask the how to know whether the script is running under...
6
by: tvaughan77 | last post by:
Hi, I have some code that I want to use to run a command line utility and I want to be able to run it from an aspx page running under IIS. The command line utility is a local utility running on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.