Page 1 of 1 1
Topic Options
#182811 - 2007-11-20 12:28 PM Displaying a 2-dimensional array
Darren_W Offline
Hey THIS is FUN
*****

Registered: 2001-10-10
Posts: 208
Loc: Bristol, England
Hi
I'm using Jens Meyer's ReadEventlog() function to read the event log, but I'm having difficulty getting it to work.

Looking at my event log I have a few event No. 1090's under applications so I run the script as thus:
 Code:
$events = ReadEventlog('Application',1090)
for each $event in $events
   for $count 0 to 15
	$event [$count] ?
   next
next
@ERROR+" Error returned" ?
 "please press a key to continue" ?
Gets $


But it does not return any data, just error -1, I've got a feeling I'm missing something here, my knowledge is a little limited with arrays?

Darren




Top
#182830 - 2007-11-20 09:31 PM Re: Displaying a 2-dimensional array [Re: Darren_W]
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Quickly noticed you have a typo there:

for $count 0 to 15

should be

for $count = 0 to 15

-Shawn

Top
#182851 - 2007-11-21 10:43 AM Re: Displaying a 2-dimensional array [Re: Shawn]
Darren_W Offline
Hey THIS is FUN
*****

Registered: 2001-10-10
Posts: 208
Loc: Bristol, England
Thanks

I've now taken another approach, I'm using log parser to evaluate the logs.

What I'm doing is running an external batch file with this as the content:
 Code:
"C:\Program Files\Log Parser 2.2\LogParser.exe" -i:EVT -o:NAT "SELECT Message FROM System WHERE EventID IN (133) AND Sourcename LIKE 'Removable Storage Service' AND TimeWritten >= SUB( TO_LOCALTIME(SYSTEM_TIMESTAMP()), TIMESTAMP('0000-01-02', 'yyyy-MM-dd') )"


and calling it with pipe (). I would though like to have it incorporated all in kixtart but I've had real difficulties because the speech marks are not getting passed correctly when the line is passed to pipe().

I'm then parsing the content for strings using a line like this:

 Code:
$listing = pipe('$call')
		For Each $file In $listing
			;locate $
			if instr($file,"requires cleaning")
			$clean=1
			endif
		Next


Darren
_________________________
I want to share something with you - the three sentences that will get you through life.
Number 1, 'cover for me.'
Number 2, 'oh, good idea, boss.'
Number 3, 'it was like that when I got here'.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 384 anonymous users online.
Newest Members
SERoyalty, mytar, Gabriel, Alex_Evos, Dansen
17869 Registered Users

Generated in 0.051 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org