[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Timenum() question



PureBytes Links

Trading Reference Links

Tom,

> It seems that mytime is assigned the value in the if statement.

That is exactly what is happening.

'=' is the assignment operator. You need '==' for the conditional (ie.
comparison) operator.

Regarding the first part, where you say you get either zero or 142059,
where are you seeing those values? TimeNum returns an array. Is the
whole array full of those values, and is it 142059 every time you call
TimeNum?

Regards,
GP


--- In amibroker@xxxxxxxxxxxxxxx, "professor77747" <professor@xxx> wrote:
>
> If I want to assign the current time to a variable, how do I do it? I 
> have tried this 
> 
> myhours=TimeNum();
> 
> 
> However, I will get either a value of 0 or I get 142059. I don't 
> understand why I would get two different values especially when both 
> of them are wrong. 
> 
> Also,when I use this if statement, I get the value for mytime as 800 
> which then assigns Conditon201 a value of 100.
> 
> mytime= IIf (myhours >=153000 AND myhours <=163100,200,100);
> 
> if (mytime =800 )
> 
>     Condition201=200;
> else 
> {
>      Condition201=100;
> }
> 
> If I change it to this,
> 
> mytime= IIf (myhours >=153000 AND myhours <=163100,2300,100);
> if (mytime =200 )
> 
>     Condition201=200;
> else 
> {
>      Condition201=100;
> }
> 
> it then assigns Condition201 a value of 200 even when the time is not 
> correct and mytime should be 100. It seems that mytime is assigned 
> the value in the if statement. 
> 
> What am I doing wrong?
> 
> Thanks,
> Tom
>




Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/