I think the problem with

 Code:
$events_1030 = ReadEventlog('Application',1030,'2008/01/01 00:00:00')


Is that it's assigning '2008/01/01 00:00:00' to the 'optional $computer' variable. Have a look at the first 'code' line of the UDF ReadEventLog:

 Code:
function ReadEventlog($eventlog, optional $eventid, optional $computer, optional $datetime, optional $username, optional $password)


What I think is happening is it's entering the function with the following variables

$eventlog = Application
$eventid = 1030
$computer = 2008/01/01 00:00:00
$datetime = [Null]

Try this instead:

 Code:
$events_1030 = ReadEventlog('Application',1030,@WKSTA,'2008/01/01 00:00:00')


@WKSTA just returns the name of the current computer.

And see if it makes a difference. I dont know enough about kix or programming in general to know if you can tell the function to use only specific optional variables without recoding the UDF. As far as i'm aware, you will have to go left to right filling in any optional variables until you have got to the ones you wanted.

Luke


Edited by lukeod (2008-02-26 12:38 AM)