Raised This Month: $ Target: $400
 0% 

[check] is this code correct/ pls check


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
avril-lavigne
Banned
Join Date: Apr 2009
Old 11-12-2011 , 18:44   [check] is this code correct/ pls check
Reply With Quote #1

PHP Code:
new day[2]; 
        
get_time("%w"day1)
        if(
equal(day"1"))
     {
        
set_task(5.0,"start_scan",_,_,_,"b")
     }
        else if(
equal(day"2"))
     {
        
set_task(5.0,"start_scan1",_,_,_,"b")
     }

        else if(
equal(day"3"))
     {
        
set_task(5.0,"start_scan",_,_,_,"b")
     }
        else if(
equal(day"4"))
     {
        
set_task(5.0,"start_scan1",_,_,_,"b")
     }

        else if(
equal(day"5"))
     {
         
set_task(5.0,"start_scan",_,_,_,"b")
     }
         else if(
equal(day"6"))
     {
         
set_task(5.0,"start_scan1",_,_,_,"b")
     }
         else if(
equal(day"0"))
     {
         
set_task(5.0,"start_scan",_,_,_,"b")
     }


is it correct ? to set task on monday tuesday and other days.
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-12-2011 , 18:51   Re: [check] is this code correct/ pls check
Reply With Quote #2

Quote:
Originally Posted by avril-lavigne View Post
is it correct ? to set task on monday tuesday and other days.
What does each task do, it may be even simpler than the below
PHP Code:
new day]; 
get_time"%w" day )

switch ( 
str_to_numday ) )
{
    case 
0set_task5.0 "start_scan" , .flags="b" )
    case 
6set_task5.0 "start_scan1" , .flags="b" )
}

// or

new iDay  str_to_numday );
set_task5.0 , ( !iDay || ( iDay ) ) ? "start_scan" "start_scan1" , .flags="b" 
__________________

Last edited by Bugsy; 11-13-2011 at 00:45.
Bugsy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode