Page 1 of 1 1
Topic Options
#73330 - 2003-02-23 12:35 AM commenting WebsiteStatus() UDF
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
doc, could the mailing be made optional?

I don't like trash-email.

if no e-mail address given, it could just set errorcode.
_________________________
!

download KiXnet

Top
#73331 - 2003-02-22 11:34 PM Re: commenting WebsiteStatus() UDF
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
I suppose it could, but then what is the purpose of having it monitor if you're not going to have it tell you somehow that the site is down.

Example:

I run it all the time from work, but I'm when I'm at home I'd like to get email or page to let me know the site is down. Also, it is an email record of times the site was down.

Top
#73332 - 2003-02-22 11:39 PM Re: commenting WebsiteStatus() UDF
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
That was my thought too, but I'm glad you said it. Figured it to be a vodka thing. [Wink]

I suppose someone could rewrite it to beep their speaker or whatever they want in place of an email.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#73333 - 2003-02-22 11:47 PM Re: commenting WebsiteStatus() UDF
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Ah, the light just came on! I think he wants the UDF to simply return the status in the errorcode. That way the action could be done in the body of the script instead of in the UDF.

Makes sense... UDFs should try to limit their function to one thing. Either do the function within the UDF, returning success or failure, or just return the status.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#73334 - 2003-02-23 12:01 AM Re: commenting WebsiteStatus() UDF
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yeah, boys you are slow!
even you have no vodka!

or maybe that's the reason.
indeed, I want the udf to check the status, I can then decide what I want to do with that status info.

[ 23. February 2003, 00:01: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#73335 - 2003-02-23 12:43 AM Re: commenting WebsiteStatus() UDF
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
ah... otay panky. No Vodka here.. only Tequilla

I'll think about it... have to go play Ghost Recon now though.

l8r

Top
#73336 - 2003-02-23 05:25 PM Re: commenting WebsiteStatus() UDF
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
DOC,
Did you forget to close $http?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#73337 - 2003-02-23 07:11 PM Re: commenting WebsiteStatus() UDF
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yes he did.
actually, he forgot to even dim anything in there.

so, once you call the function the memory is reserved until script execution stops.

all vars should be dimmed in all UDFs. specially this one as it uses varnames that can occur in the main script too.
_________________________
!

download KiXnet

Top
#73338 - 2003-02-23 07:38 PM Re: commenting WebsiteStatus() UDF
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Someone should write a HOWTO on UDFs.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#73339 - 2003-02-24 04:02 AM Re: commenting WebsiteStatus() UDF
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I hear ya [Wink]
_________________________
There are two types of vessels, submarines and targets.

Top
#73340 - 2003-02-24 05:46 AM Re: commenting WebsiteStatus() UDF
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Okay Okay... I'll quit writing them. I'll leave it to those with more experience. [Wink]

In the one I worked on later, I did close that var. I did not want to DIM in the UDF as I don't know how to easily retrieve it back outside the UDF. I did originally also have them dimmed but as I said, I could not easily retrieve their values outside the UDF.

I've learned quite a bit in recent months, but I know I have a long way to go with writing "correct" tight code.

Top
#73341 - 2003-02-24 05:52 AM Re: commenting WebsiteStatus() UDF
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Don't quit DOC. Ideally, vars should be DIM'd local and data should pass through the parameters and/or the @Error set on EXIT. I know that it's not always possible but that is what one should strive for.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.075 seconds in which 0.033 seconds were spent on a total of 12 queries. Zlib compression enabled.

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