A89: Please help with C


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

A89: Please help with C




Below is my source. I can not figure out why it wont compile. It is
something with loading the variable "buffer" to restore the screen at the
end of the program. I don't think I am understanding the jumping and
labeling part of C. I haven't read anything on it this is just what I have
learned from looking at others source code.
I also have another question how do you do "or" or "and" in a conditional
statement like.....
if varibleA = VariableB and VariableC - VariableA
{.....
}
Thanks for the help.


//my code
#include <doors.h>
#include <graph.h>
#include <kbd.h>

int _ti89,_ti92plus;      // compile for both calcs
int font;
int kbkey;
void _main(void)
{
  LCD_BUFFER buffer;
  LCD_save(buffer);
  font = 2;
  FontSetSys(F_6x8);

int main2(void)
{ 
  ClrScr();
  DrawStr(3,3,"Move Me",A_NORMAL);
  loop();
}
int loop(void)
{
 kbkey = ngetchx();
 if(kbkey == 43)
  { if(font == 2)
    { font += 1;
      FontSetSys(F_8x10);
	}
    if(font == 3) 
	{
    }  
	if(font == 1)
	{ font += 1;
      FontSetSys(F_6x8);
    }  
  }
  if(kbkey == 45)
  { if(font == 2)
    { font -= 1;
      FontSetSys(F_4x6);
    }
	  if(font == 1)
    { 
    }
	  if(font == 3)
    { font -= 1;
      FontSetSys(F_6x8);
    }
  }
 if(kbkey != 264)
  { main2();
  }
 }
 LCD_restore(buffer);
}


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com



Follow-Ups: References: