Author Topic: Hello and my first dumb question  (Read 8069 times)

DJS05101985

  • Newbie
  • *
  • Posts: 18
    • View Profile
Hello and my first dumb question
« on: March 07, 2013, 01:20:44 pm »
Hi All -

My name is Dan and my background is in computational physics. I have a good deal of programming experience in C++, Perl, etc., etc. and I'm trying to learn the nuances of AmiBroker. At present I have a very basic "Hello World" program that I am trying to run. In formula editor
Code: [Select]
i=0;
while (i<10)
{
i++;
printf ("Hello world number %gn",i);
}
and then I click the "Analysis" icon in the upper right hand corner (graphics look like 3 boxes: one red, one green, one yellow). I can't seem to find which window the output gets printed. Anyone point me in the right direction?

Thanks very much for your help.

DJS05101985

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Hello and my first dumb question
« Reply #1 on: March 07, 2013, 01:40:31 pm »
p.s. - I did read the language reference and it seems to indicate the printout is to either the commentary window or the interpretation window. Under the window menu, I do not see "Commentary". I do see "Interpretation" and I can open that window but I do not seem my program output.

EDIT: So it seems that sporadically the printf message appears in the interpretation window. But it does not update regularly. It also seems to only work when I "Apply Indicator" under the tools menu and not when I perform a scan, exploration, or backtest.
« Last Edit: March 07, 2013, 03:24:32 pm by DJS05101985 »

Aminerd

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Hello and my first dumb question
« Reply #2 on: March 07, 2013, 04:33:18 pm »
printf is for commentary and interpretation window as you have aknowledged. So no it is not for analysis window. commentary can be found in Analysis -> Commentary

What do you mean it doesn't update?

Don't you get this one


if using

Code: [Select]
i = 0;

while ( i < 10 )
{
    i++;
    printf ( "Hello world number %g\n", i );
}

« Last Edit: March 07, 2013, 04:39:34 pm by Aminerd »

DJS05101985

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Hello and my first dumb question
« Reply #3 on: March 07, 2013, 04:56:14 pm »
So I think my primary problem was that I did not know the window associated with the scripted needed the focus for the interpretation window to display the printf text. I think I got it now. What may be of more use to me would be something that dumps a whole bunch of data for the purposes of debugging runtime errors. I believe the program DebugViewer is advertised on the web to read information generated by the _TRACE keyword. However, I can not find a link to download DebugViewer!

Anyway, thanks so much for the help and if anyone has a link to download DebugViewer, it would be much appreciated.

Aminerd

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Hello and my first dumb question
« Reply #4 on: March 07, 2013, 07:07:19 pm »
debugviewer is a microsoft software. Just use google

But you can also use intern logger

« Last Edit: March 07, 2013, 07:12:33 pm by Aminerd »

Aminerd

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Hello and my first dumb question
« Reply #5 on: March 07, 2013, 07:10:33 pm »
You said you have experience in C++.

So you can also use AmiBroker's free SDK called Amibroker Development Kit for C/C++ or .Net for Amibroker http://www.dotnetforab.com/ for  C#, VB.NET, VC.NET, F#, or any

Aminerd

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Hello and my first dumb question
« Reply #6 on: March 07, 2013, 07:11:33 pm »

Aminerd

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Hello and my first dumb question
« Reply #7 on: March 07, 2013, 07:19:02 pm »
But you can also use intern logger



Can be enabled in preferences also


DJS05101985

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Hello and my first dumb question
« Reply #8 on: March 08, 2013, 08:10:32 am »
Woah thanks for all that info AmiNerd. Great stuff. The AFL language is close enough to C++ that I can follow the syntax and the pre-packaged routines are really efficient but I might look at switching over -- just because C++ offers more options on outputting text.

Anyway, thanks again.