Hi,

i need help or a code for building a menu and a input/output with c.
i want a menu with PrintMini with 6 lines and scrollfunction.

for example:

F1:test
F2:test2
F3:
F4:
F5:
F6:


Then i want to put two strings input and then calculate that and put it out.

for example:

"a"? // to a variable
"b"? // to a variable
c= a+b
"c=" //output ( PrintMini)

Thanks.
Welcome to Cemetech, Nossi. It looks like you're working with the Prizm based on wanting to use PrintMini for your menu. For the menu, you pretty much want to print your options, then use GetKey() together with logic to move a cursor up and down and detect [ENTER] to accept a selection from the user. For input and output, you could use my input routine here to do input; output should be relatively obvious. Let us know if you have any follow-up questions.

Edit: gbl08ma has suggested that you instead take a look at this information.
the input routine doesnt work, i have a compile error.

eingabe.c:106:23: error: 'KEY_PRGM_DEL' undeclared (first use in this function)
eingabe.c:135:11: error: 'for' loop initial declarations are only allowed in C99 mode
eingabe.c:167:9: error: 'for' loop initial declarations are only allowed in C99 mode
eingabe.c:170:17: error: redefinition of 'i'
eingabe.c:170:9: error: 'for' loop initial declarations are only allowed in C99 mode
Looks like you are trying to define your variables inside the loop, which is not supported by the compiler.

Instead of:

Code:

for(int i=0; i < SomeNum; i++) { // Code }


Use:

Code:

int i=0;
for(i; i < SomeNum; i++) { // Code }


Also, you need to define KEY_PGRM_DEL somewhere in your program, either as a define or I assume a global variable.
Side-note: When compiling, you can change the C standard used. However you are building your code with gcc, add in the flag
Code:
-std=gnu99
which will allow you to use more modern language features, such as declarations in for loops.

On-topic: I recommend pasting your code here in [ⅽode] [/code] tags if it is short or pasting a link to a paste site, such as pastebin.

For the first error, the header... doesn't exactly have that define. However, there is a version with that included: https://www.cemetech.net/forum/viewtopic.php?p=197950#197950
ok, i can compile without errors. but now i have a white screen on the fx.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement