A million thanks for your help and my project is getting better. My objective as a maths teacher is to produce an add on that adds loads of functions of maths questions and answers.
My code is now:
#include "fxlib.h" #include "dispbios.h" #include "keybios.h" int mainmenu(); void respondToMain(int); int AddIn_main(int isAppli, unsigned short OptionNum) { int response = mainmenu(); respondToMain(response); } #pragma section _BR_Size unsigned long BR_Size; #pragma section #pragma section _TOP int InitializeSystem(int isAppli, unsigned short OptionNum) { return INIT_ADDIN_APPLICATION(isAppli, OptionNum); } #pragma section int mainmenu(){ unsigned int key; int result; Bdisp_AllClr_DDVRAM(); Bdisp_AreaReverseVRAM(5, 57, 20, 63); // F1 PrintMini(11,58,(unsigned char*)"1",MINI_REV); Bdisp_AreaReverseVRAM(26, 57, 41, 63); // F2 PrintMini(32,58,(unsigned char*)"2",MINI_REV); Bdisp_AreaReverseVRAM(47, 57, 62, 63); // F3 PrintMini(53,58,(unsigned char*)"3",MINI_REV); Bdisp_AreaReverseVRAM(68, 57, 83, 63); // F4 PrintMini(74,58,(unsigned char*)"4",MINI_REV); Bdisp_AreaReverseVRAM(89, 57, 104, 63); // F5 PrintMini(95,58,(unsigned char*)"5",MINI_REV); PrintXY(10, 5,(unsigned char*)"1. Algebra", 0); PrintXY(10, 15,(unsigned char*)"2. Number", 0); PrintXY(10, 25,(unsigned char*)"3. Shape", 0); PrintXY(10, 35,(unsigned char*)"4. Data", 0); PrintXY(10, 45,(unsigned char*)"5. A Level", 0); Bdisp_PutDisp_DD(); GetKey(&key); switch(key){ case KEY_CTRL_F1: result = 1; break; case KEY_CTRL_F2: result = 2; break; } return result; } void respondToMain(int response){ unsigned int key; while(1){ GetKey(&key); switch(response){ case 1: PrintMini(10,10,(unsigned char*)"1",MINI_REV); break; case 2: PrintMini(10,10,(unsigned char*)"2",MINI_REV); break; } Bdisp_PutDisp_DD(); } }
So how do I allow the user to put input and how do I get that into my code? Seems that would be easy but the SDK does not seem to have this functions. Seems strange to be not to have these but still.
Thanks again for all your help.
Paul Brassington
Edited by flyingfisch, 05 March 2013 - 11:00 PM.
wrapped your code in tags, makes it much easier to read. ;)