How to use FileSystemEventHandler

Posted by Admin on 28-Jan-2009 06:06

Hi,

What would be an ABL equivalent of this code (c#)?

FileSystemWatcher watcher = new FileSystemWatcher();

// Add event handlers.

watcher.Changed += new FileSystemEventHandler(OnChanged);

private static void OnChanged(object source, FileSystemEventArgs e)

{

}

I did:

DEFINE VARIABLE watcher AS System.IO.FileSystemWatcher.

DEFINE VARIABLE fseh AS System.IO.FileSystemEventHandler.

watcher = NEW System.IO.FileSystemWatcher().

fseh = NEW System.IO.FileSystemEventHandler(watcher,onchange()).

but it is complaining that

method onchange returns a void so cannot be used in an expresssion.

TIA.

Parul.

All Replies

Posted by Admin on 28-Jan-2009 06:19

In a procedure:

On a class:

Note, that for a procedure, the name of the internal procedure gets quoted, in a class the method name does not require/allow quotes.

Mike

Posted by Admin on 28-Jan-2009 06:57

Brilliant!!!!

Thank a lot.

-Parul.

This thread is closed