{
//menutest.c
TControlBar bar("vertical");
bar->AddButton("Test",".x inputtest.c", "For menu testing");
bar.Show();
gROOT.SaveContext();
}
to use this macro, named "inputtest.c":
{
//inputtest.c
int i;
char s[50];
float f;
printf("enter an integer: ");
scanf("%d",&i);
printf("enter a string: ");
scanf("%s",s);
printf("enter a float: ");
scanf("%f",&f);
printf("integer: %d string: %s float: %f\n",i,s,f);
}
If I run menutest.c and then press the button to run inputtest.c, I get
results like this:
root [1] enter an integer: 521
enter a string: hello
enter a float: 85.23
integer: 521 string: ello float: 5.230000
Error: No symbol h8 in current scope FILE:C:\TEMP\250 LINE:1
*** Interpreter error recovered ***
root [2]
The error message only occurs after I hit the return key. Apparently it
then spits out the lost "h" and "8" from the second and third input. And
I've also noticed that when I'm entering "hello" above I am unable to
backspace past the "e"; the "h" cannot be removed.
I have no idea why this happens. If anyone does have a clue about this or
how I might rectify it, or avoid it, please let me know. For now the only
way I can use a TControlBar to run my macros is to enter an additional
space every time I enter keyboard data.
Thanks,
Matt Fritts