[Gambas-user] Finally.. My First Gambas APP

Brant Wells bwells at ...475...
Thu Jun 17 19:53:06 CEST 2004


Hi All...

Okay... Here it is...  exclusively posted for my fellow Gambas users... ;-)

The more I use Gambas, the more I like it!  I've been asking a lot of 
questions about the exec[] functions, and had a hard time getting it to 
do what I want...  But I finally came up with a viable workaround... 
(grin)... 

This application is fairly simple when compared to stuff like a 
Double-Buffered space game.. (thumbs up to Rob!)...  But it's my first...

Basically, the program deciphers Either a mail log, or a DHCP log.  To 
actually run the program, you will need to know the root-user's 
password.   It will copy the appropriate file to the /tmp folder, chown 
it to the user who is running the application, and open the file and 
read it, one line at a time.

The Process DHCP file Button searches through the file you choose as the 
DHCP file, looking for the string "DHCPACK"...  If it finds it, then it 
will Return the IP Address, and the MAC address that the IP was given to.

The combo box will let you chose "ALL", "DMZ,"Admin","Lab/Library", and 
"Students"...  Look at the code to see how I got it to match the IP 
Ranges...So, off the bat, only ALL will work on the DHCP side...

The Process Mail button should be self explanatory...  It simply reads 
through the file, searching for the strings given, and keeps a count as 
to how many times those strings appear.  At the end, it posts the 
results to the text box...  Note: As I'm following the source code 
through the file, I see that I forogt to add the # of locked mail boxes 
to the end of the file...  To fix this, simply add 

& "Locked Mailboxes: " & locked & vbcrlf

to the end of the txtlog.text=blah blah blah....

As you are looking throught he source code...  Notice that I had a bit 
of nostalgia... I had to add in a vbCRLF to the program...No offense, 
Benoit ;)

I also created my own clsDialog, as I couldn't quite figure out how to 
operate the Gambas Dialog thingy...  Right now, it only has one method, 
OpenFile, and one Property, FileName..

Okay...  This email is long enough now... I can mail out DHCP logs to 
anybody who needs them. ;-)

Check it out, pick it apart, if you must flame me, please send all 
emails to bwells at ...482... ;-)

See Ya, Guys!
~Brant

-------------- next part --------------
A non-text attachment was scrubbed...
Name: LogView-0.0.8.tar.gz
Type: application/x-gzip
Size: 4408 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20040617/aa9bb2f9/attachment.bin>


More information about the User mailing list