Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / August 2005

Tip: Looking for answers? Try searching our database.

Last version of jscript.net broken in some ways ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
adragomir - 11 Aug 2005 15:19 GMT
Hello everyone.

When testing the Jscript.NET on the .NET 2.0 Beta 2 (JScript
8.00.50215), I found an older example, with a FileSystemWatcher thread
example.

below is the example

// ----- file 'watcher.js' -----

import System.Threading;
import System.IO;

// Placeholder class to hold the delegate (callback)
class Delegates {
    static function Handler(o : Object, e : FileSystemEventArgs) {
        print(e.FullPath);
        // Stop when a file including the word "quit" is created
        if (e.FullPath.indexOf("quit") >= 0) {
            keepGoing = false;
        }
    }

    static function Main() {
        // Create the directory listener
        var w : FileSystemWatcher = new FileSystemWatcher("c:\\temp",
"*.txt");

        // Add the event handler (ignore compiler warning)
        w.add_Created(Handler);
        //w.Enabled = true;

        // Sleep a while and see if it is time to quit
        while(keepGoing)
            Thread.Sleep(500);
    }

}

// Start off a new thread to keep the process alive
var keepGoing = true;
new Thread(Delegates.Main).Start();

// ----- Command Line -----

Well, this was supposed to give a warning message for the "add_Created"
part. It now doesn't, although it complains about w.Enabled o existent.

HOWEVER, on the last line, "new Thread(Delegates.Main).Start();" I get
the following compiler error:

JS1184: More than one constructor matches this argument list

I looked in the error descriptions, but I can't figure out why this
happens. Any help would be appreciated.

Also, below is the link to the older message( where I got the source
code from)

http://groups.google.com/group/microsoft.public.dotnet.languages.jscript/browse_
thread/thread/6688cf1e3ad718e1/65de20cfd1fe3fa7?q=new+Thread(Delegates.Main).Sta
rt();&rnum=1&hl=en#65de20cfd1fe3fa7


Regards,
 Andrei
Serge Baltic - 24 Aug 2005 13:55 GMT
Hello,

a> HOWEVER, on the last line, "new Thread(Delegates.Main).Start();" I
a> get the following compiler error:
a>
a> JS1184: More than one constructor matches this argument list
a>
a> I looked in the error descriptions, but I can't figure out why this
a> happens. Any help would be appreciated.

I've had the same problem. AFAIR that happened due to new overloads of the
Thread..ctor method introduced to the 2.0 version of the .NET framework,
so the JScript compiler cannot tell between them any more. You may fix this
problem by adding an explicit typecasting, or something like that — that's
how I made it.

(H) Serge

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.