Need some newbie help please
- SimonLothar
- Senior Member
-
- Posts: 605
- Joined: Sat Sep 15, 2012 6:59 am
- Location: Krautland ****
- Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400
Re: Need some newbie help please
This time it complains about "stringSet".
Now comment the complete function "void callbackEvents(void* ptr){...}" and retry a rebuild.
Perhaps you could show the contents of the file test.g1w, too.
Now comment the complete function "void callbackEvents(void* ptr){...}" and retry a rebuild.
Perhaps you could show the contents of the file test.g1w, too.
I'll be back!
- MrMagoo
- Member
-
- Posts: 44
- Joined: Tue Jul 02, 2013 11:57 am
- Location: London
- Calculators: Casio fx-7400G, Casio fx-7400G PLUS, Casio fx-7400GII, Casio fx-9750G, Casio fx-9750G PLUS, Casio fx-9860GII
Re: Need some newbie help please
Ok, you lost me now.
I dont know what callbackEvents is, or how to complete the function. I literally copied and pasted from the mylib example.
test.g1w produces this;
I dont know what callbackEvents is, or how to complete the function. I literally copied and pasted from the mylib example.
test.g1w produces this;
- Code: Select all
[DLSimProject]
Name=Test
Version=1.0
Model=:fx-9860G.dlm
SourcePath=SRC
MemoryPath=INIT
MemCardPath=SDCard
[Program1]
Program=Test.G1A
Debug=Debug\FXADDINror.dbg
LoadAddress=80000000:90100000
[Files]
SourceFile=:Test.c
"The trouble with internet quotations, is that the majority are totally made up." - Abraham Lincoln 1863
- SimonLothar
- Senior Member
-
- Posts: 605
- Joined: Sat Sep 15, 2012 6:59 am
- Location: Krautland ****
- Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400
Re: Need some newbie help please
To comment a function is to enclose it in /* and */. This prevents the compiler to heed for this part of the source code, f. i. while testing.
Usually /* and */ are used to write a block comment. Sometimes, if you want to exclude a piece of code from compiling, you enclose this code with /* and */, too.
If a compiling error does not occur after you commented a part of the code, you know, that the problem lies within the commented code. This is one way to isolate bugs.
The dump of your test.g1w shows no sign of mylib.c in the files-section. Try to include mylib.c into the list of source files. There must be some panel in the SDK's workbench called "source files" or such (I do not have a SDK in this office, so I cannot tell the exact description). mylib.c must be included there, otherwise the compiler cannot find mylib's functions.
Usually /* and */ are used to write a block comment. Sometimes, if you want to exclude a piece of code from compiling, you enclose this code with /* and */, too.
If a compiling error does not occur after you commented a part of the code, you know, that the problem lies within the commented code. This is one way to isolate bugs.
The dump of your test.g1w shows no sign of mylib.c in the files-section. Try to include mylib.c into the list of source files. There must be some panel in the SDK's workbench called "source files" or such (I do not have a SDK in this office, so I cannot tell the exact description). mylib.c must be included there, otherwise the compiler cannot find mylib's functions.
I'll be back!
- MrMagoo
- Member
-
- Posts: 44
- Joined: Tue Jul 02, 2013 11:57 am
- Location: London
- Calculators: Casio fx-7400G, Casio fx-7400G PLUS, Casio fx-7400GII, Casio fx-9750G, Casio fx-9750G PLUS, Casio fx-9860GII
Re: Need some newbie help please
Ah ha! That worked! Excellent.
Thanks
So now I basically want to create a menu, with various choices.
Each choice will take the user to a different type of calculation, with various different inputs. Produce a result, then take them back to the main menu.
Whats the best way of going about this?

So now I basically want to create a menu, with various choices.
Each choice will take the user to a different type of calculation, with various different inputs. Produce a result, then take them back to the main menu.
Whats the best way of going about this?
"The trouble with internet quotations, is that the majority are totally made up." - Abraham Lincoln 1863
- SimonLothar
- Senior Member
-
- Posts: 605
- Joined: Sat Sep 15, 2012 6:59 am
- Location: Krautland ****
- Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400
Re: Need some newbie help please
MrMagoo wrote:So now I basically want to create a menu, with various choices.
Each choice will take the user to a different type of calculation, with various different inputs. Produce a result, then take them back to the main menu.
Whats the best way of going about this?
mylib seems to contain some appropriate functions (Though I do not know mylib in detail).
But I'd recommend to try some basic exercises yourself to get accustomed with the system.
Use locate() and Print() to display the choices:
f. i.
F1: option 1
F2: option 2
EXIT: return
wait for the user input with GetKey()
use a switch-construct to decide, what to do in response to the key, which has been hit.
- Code: Select all
int lContinue = 1;
while( lContinue ){
GetKey( &key );
switch (key){
case KEY_CTRL_F1 :
option1();
break;
case KEY_CTRL_F2 :
option2();
break;
case KEY_CTRL_EXIT :
lContinue = 0;
break;
}
}
with the function definitions
- Code: Select all
void option1(){
...
}
void option2(){
...
}
These functions could do anything you want, f. i. perform a secondary menu, display some information or ask for some.
I'll be back!
- MrMagoo
- Member
-
- Posts: 44
- Joined: Tue Jul 02, 2013 11:57 am
- Location: London
- Calculators: Casio fx-7400G, Casio fx-7400G PLUS, Casio fx-7400GII, Casio fx-9750G, Casio fx-9750G PLUS, Casio fx-9860GII
Re: Need some newbie help please
I tried this, but keep getting illegal token errors
- Code: Select all
#include "fxlib.h"
#include <stdio.h>
int AddIn_main(int isAppli, unsigned short OptionNum)
{
unsigned int key;
Bdisp_AllClr_DDVRAM();
locate(1,1);
Print((unsigned char*)"Menu");
locate(1,2);
Print((unsigned char*)"[F1] Option1");
locate(1,3);
Print((unsigned char*)"[F2] Option2");
int lContinue = 1;
while( lContinue ){
GetKey( &key );
switch (key){
case KEY_CTRL_F1 :
option1();
break;
case KEY_CTRL_F2 :
option2();
break;
case KEY_CTRL_EXIT :
lContinue = 0;
break;
}
}
void option1(){
Bdisp_AllClr_DDVRAM();
locate(1,2);
Print((unsigned char*)"You pressed Option1");
}
void option2(){
Bdisp_AllClr_DDVRAM();
locate(1,2);
Print((unsigned char*)"You pressed Option2");
}
//****************************************************************************
//************** ****************
//************** Notice! ****************
//************** ****************
//************** Please do not change the following source. ****************
//************** ****************
//****************************************************************************
#pragma section _BR_Size
unsigned long BR_Size;
#pragma section
#pragma section _TOP
//****************************************************************************
// InitializeSystem
//
// param : isAppli : 1 = Application / 0 = eActivity
// OptionNum : Option Number (only eActivity)
//
// retval : 1 = No error / 0 = Error
//
//****************************************************************************
int InitializeSystem(int isAppli, unsigned short OptionNum)
{
return INIT_ADDIN_APPLICATION(isAppli, OptionNum);
}
#pragma section
- Code: Select all
Executing Hitachi SH C/C++ Compiler/Assembler phase
set SHC_INC=E:\Casio\OS\SH\include
set PATH=E:\Casio\OS\SH\bin
set SHC_LIB=E:\Casio\OS\SH\bin
set SHC_TMP=E:\Casio\Projects\S\Debug
"E:\Casio\OS\SH\bin\shc.exe" -subcommand=C:\Users\D~1.LAW\AppData\Local\Temp\hmk1EAD.tmp
E:\Casio\Projects\S\S.c(19) : C2500 (E) Illegal token "int"
E:\Casio\Projects\S\S.c(19) : C2225 (E) Undeclared name "lContinue"
E:\Casio\Projects\S\S.c(19) : C2220 (E) Modifiable lvalue required for "="
E:\Casio\Projects\S\S.c(37) : C2500 (E) Illegal token "void"
E:\Casio\Projects\S\S.c(37) : C2500 (E) Illegal token "{"
E:\Casio\Projects\S\S.c(43) : C2500 (E) Illegal token "void"
E:\Casio\Projects\S\S.c(43) : C2500 (E) Illegal token "{"
E:\Casio\Projects\S\S.c(61) : C2709 (E) Illegal section name declaration
E:\Casio\Projects\S\S.c(62) : C2500 (E) Illegal token "unsigned"
E:\Casio\Projects\S\S.c(62) : C2225 (E) Undeclared name "BR_Size"
E:\Casio\Projects\S\S.c(63) : C2709 (E) Illegal section name declaration
E:\Casio\Projects\S\S.c(66) : C2709 (E) Illegal section name declaration
E:\Casio\Projects\S\S.c(77) : C2500 (E) Illegal token "int"
E:\Casio\Projects\S\S.c(77) : C2500 (E) Illegal token "int"
E:\Casio\Projects\S\S.c(78) : C2500 (E) Illegal token "{"
E:\Casio\Projects\S\S.c(82) : C2709 (E) Illegal section name declaration
E:\Casio\Projects\S\S.c(83) : C2500 (E) Illegal token ""
HMAKE MAKE UTILITY Ver. 1.1
Copyright (C) Hitachi Micro Systems Europe Ltd. 1998
Copyright (C) Hitachi Ltd. 1998
"The trouble with internet quotations, is that the majority are totally made up." - Abraham Lincoln 1863
- SimonLothar
- Senior Member
-
- Posts: 605
- Joined: Sat Sep 15, 2012 6:59 am
- Location: Krautland ****
- Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400
Re: Need some newbie help please
There is a closing curly bracket missing.
- Code: Select all
int lContinue = 1;
while( lContinue ){
GetKey( &key );
switch (key){
case KEY_CTRL_F1 :
option1();
break;
case KEY_CTRL_F2 :
option2();
break;
case KEY_CTRL_EXIT :
lContinue = 0;
break;
}
}
} // this is the missing curly bracket
void option1(){
Bdisp_AllClr_DDVRAM();
locate(1,2);
Print((unsigned char*)"You pressed Option1");
}
I'll be back!
- MrMagoo
- Member
-
- Posts: 44
- Joined: Tue Jul 02, 2013 11:57 am
- Location: London
- Calculators: Casio fx-7400G, Casio fx-7400G PLUS, Casio fx-7400GII, Casio fx-9750G, Casio fx-9750G PLUS, Casio fx-9860GII
Re: Need some newbie help please
Ok that fixed that issue,
I now have this error
E:\Casio\Projects\S\S.c(44) : C2144 (E) Type mismatch
On this line;
I now have this error
E:\Casio\Projects\S\S.c(44) : C2144 (E) Type mismatch
On this line;
- Code: Select all
void option1() {
"The trouble with internet quotations, is that the majority are totally made up." - Abraham Lincoln 1863
- helder7
- Senior Member
- Posts: 369
- Joined: Tue Jan 03, 2012 11:24 pm
- Calculators: Casio Afx 1.0, Casio fx-9860GII SD, Casio Classpad 330, Casio fx-CG20, Casio Classpad fx-CP400
Re: Need some newbie help please
try add
before int AddIn_main:
- Code: Select all
void option1();
void option2();
before int AddIn_main:
- Code: Select all
#include "fxlib.h"
#include <stdio.h>
void option1();
void option2();
int lContinue = 1;
int AddIn_main(int isAppli, unsigned short OptionNum)
{
unsigned int key;
Bdisp_AllClr_DDVRAM();
locate(1,1);
Print((unsigned char*)"Menu");
locate(1,2);
Print((unsigned char*)"[F1] Option1");
locate(1,3);
Print((unsigned char*)"[F2] Option2");
while( lContinue ){
GetKey( &key );
switch (key){
case KEY_CTRL_F1 :
option1();
break;
case KEY_CTRL_F2 :
option2();
break;
case KEY_CTRL_EXIT :
lContinue = 0;
break;
}
}
}
void option1(){
Bdisp_AllClr_DDVRAM();
locate(1,2);
Print((unsigned char*)"You pressed Option1");
}
void option2(){
Bdisp_AllClr_DDVRAM();
locate(1,2);
Print((unsigned char*)"You pressed Option2");
}
//****************************************************************************
//************** ****************
//************** Notice! ****************
//************** ****************
//************** Please do not change the following source. ****************
//************** ****************
//****************************************************************************
#pragma section _BR_Size
unsigned long BR_Size;
#pragma section
#pragma section _TOP
//****************************************************************************
// InitializeSystem
//
// param : isAppli : 1 = Application / 0 = eActivity
// OptionNum : Option Number (only eActivity)
//
// retval : 1 = No error / 0 = Error
//
//****************************************************************************
int InitializeSystem(int isAppli, unsigned short OptionNum)
{
return INIT_ADDIN_APPLICATION(isAppli, OptionNum);
}
#pragma section
SiO2 + CaCO3 ----------> CaSiO3 + CO2
- MrMagoo
- Member
-
- Posts: 44
- Joined: Tue Jul 02, 2013 11:57 am
- Location: London
- Calculators: Casio fx-7400G, Casio fx-7400G PLUS, Casio fx-7400GII, Casio fx-9750G, Casio fx-9750G PLUS, Casio fx-9860GII
Re: Need some newbie help please
Boom! Yes that works perfectly.
So each function needs to be declared just like a variable? I see!
EDIT, Would I also be right in thinking if I added all the functions to their own file, and inlcuded that file, I wouldnt need to declare them? RE-EDIT, Ok I tried that and go another error * L2300 (E) Duplicate symbol "_option1" in "E:\Casio\Projects\S\Debug\S.obj"
So each function needs to be declared just like a variable? I see!
EDIT, Would I also be right in thinking if I added all the functions to their own file, and inlcuded that file, I wouldnt need to declare them? RE-EDIT, Ok I tried that and go another error * L2300 (E) Duplicate symbol "_option1" in "E:\Casio\Projects\S\Debug\S.obj"
"The trouble with internet quotations, is that the majority are totally made up." - Abraham Lincoln 1863
Who is online
Users browsing this forum: No registered users and 19 guests