posted 05-22- 04:50 AM CT (US)
Well, maybe my flashcard program wouldn't have worked even if I had variables that could hold words. I changed my scripts to avoid the need, but when I click on the flashcard (to flip to side two) it flips... and the word from side one appears. And when I click "next" to go to card 2 it flips... and the word from card one, side one reappears. The debug file keeps saying that "flashcard.c does not know variable &side" or some such thing - but I put them in the main proc of main.c along with the other global variables. Is there something else I need to do?Here is the script if you want to take a look, I'm pretty sure that if I could get it to remember the variables it would work:
in the main proc of main.c
make_global_int("&side", 1);
make_global_int("&numcard", 1);
make_global_int("&lang", 1);
flashcard.c (which is called when I click on the flashcard or a "flip" button):
void click ( void )
{
debug ("side var was &side");
If (&side == 2) &side = 1;
If (&side == 1) &side = 2;
debug ("side var is now &side");
flip();
external ("data", "data");
}
void flip (void)
{
//I flip the card over here, it works so I won't waste space
}
next.c (to go to the next card)
void click ( void )
{
debug("This is the next string");
If (&nextcard >= 12)
{
&nextcard = 1;
} else
{
&nextcard += 1;
}
&side = &lang
external ("flashcard", "flip");
external ("data","data");
}
prev.c works the same as next.c
a sample of data.c:
void data (void)
{
If (&numcard == 1)
{
If (&side == 1) say_xy(" amiko ", -40, 170);
If (&side == 2) say_xy(" friend ", -40, 170);
return;
}
If (&numcard == 2)
{
If (&side == 1) say_xy(" filo ", -40, 170);
If (&side == 2) say_xy(" son ", -40, 170);
return;
}
//and so on
}
All your help is very much appreciated
thanks.