Page 1 of 1

Stuck with a function: Return true if time between 8pm & 1am

Posted: Jul 18 2012
by arjfca
Hello

Amateur problem, but don't figure how.

I want a function :Asia , to return true if time of the bar is between 8pm and 1 am the following day ( 5H later).

Code: Select all

// Return true if asia session is on

Asia = False;

If time_S >= 200000 and (time_S <= calctime(time_s, 050000)) then Asia = True;
Any idea how i cant resolve this simple function

Martin

Re: Stuck with a function: Return true if time between 8pm &

Posted: Jul 18 2012
by TJ
Hello

Amateur problem, but don't figure how.

I want a function :Asia , to return true if time of the bar is between 8pm and 1 am the following day ( 5H later).

Code: Select all

// Return true if asia session is on

Asia = False;

If time_S >= 200000 and (time_S <= calctime(time_s, 050000)) then Asia = True;
Any idea how i cant resolve this simple function

Martin

Code: Select all

// Return true if asia session is on
var:
Asia(False);

If time_S >= 200000 or time_S <= 10000 then
Asia = True
else
Asia = False;

Re: Stuck with a function: Return true if time between 8pm &

Posted: Jul 18 2012
by arjfca
So simple.... hehe!

Another sandwich my friend....

Martin :)

Re: Stuck with a function: Return true if time between 8pm &

Posted: Jul 18 2012
by TJ
So simple.... hehe!

Another sandwich my friend....

Martin :)
this is a common oversight:

Code: Select all

...
else
Asia = False;

Re: Stuck with a function: Return true if time between 8pm &

Posted: Jul 18 2012
by TJ
So simple.... hehe!

Another sandwich my friend....

Martin :)
There is no magic to it.

What you need is clarity in what you want to achieve.

If you had written your thoughts in plain English (or whatever language you normally use),
line by line,
one thought per line,
one line at a time,
you would have coded the logic with ease.