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

[amibroker] Adjusted Data - which type is best?



PureBytes Links

Trading Reference Links

Gosub,

You missed a colon in the Calc_1 function as well as tried to call the functions before they were loaded.

Regards,
William



-----Original Message-----
From: gosub283 [mailto:gosub283@xxxxxxxxx]
Sent: Thursday January 1, 2004 5:26 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Simple function help please !


William,

Thanks for the reply.
It's not clear to me where my error was.
The only difference in your code
was that you put the functions above the
calling statements. ??
Can you point our where my syntax error is occuring ?

Thanks,
Gosub


--- In amibroker@xxxxxxxxxxxxxxx, "William Peters" 
<williampeters@xxxx> wrote:
> Hi,
> 
> function Calc_1(number)
> {
>    //Test should return "10"
>    return number * 2;
> }
> 
> function Calc_2(number)
> {
>     //Test should return (-10)
>    return number * -2;
> }
> 
> TestNumber = 1;
> 
> NewNumber = IIf( TestNumber >=0 , Calc_1(5), Calc_2(5));
> 
> Filter =1;
> AddColumn( NewNumber, "NewNumber");
> 
> 
> Regards,
> William Peters
> www.amitools.com
> 
> 
> -----Original Message-----
> From: gosub283 [mailto:gosub283@x...]
> Sent: Thursday January 1, 2004 4:51 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Simple function help please !
> 
> 
> Hi,
> 
> I'm trying to add 2 functions to my current project
> but I continue to get a syntax error when executing.
> I have drasticly simplified my functions for this
> message but the error still occurs with this simple
> code. The syntax error pointer always appears
> under the first fuction call "Calc_1(5).
> Can anyone tell me what is the syntax error in
> this code ?
> Thanks a lot....
> Gosub283
> ============================
> 
> TestNumber = 1;
> 
> NewNumber = IIf( TestNumber >=0 , Calc_1(5), Calc_2(5));
>                                 ++++++++++++
>  function Calc_1(number)
> {
>    //Test should return "10"
>    return number * 2
> }
> 
>  function Calc_2(number)
> {
>     //Test should return (-10)
>    return number * -2;
> }
> 
> 
> 
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
> Yahoo! Groups Links
> 
> To visit your group on the web, go to:
>  http://groups.yahoo.com/group/amibroker/
> 
> 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/


Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Yahoo! Groups Links

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

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/ 



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Yahoo! Groups Links

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

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/