Register

Problem with sprintf in miniSDK 1.09

Discuss issues related to the Casio Prizm 3rd party development
Member
User avatar
Posts: 21
Joined: Mon Oct 27, 2014 1:46 pm
Location: Japan
Calculators: Casio Cfx Series, Casio fx-9860G, Casio fx-9860 GII, Casio fx-9860 GII SD Power Graphic 2, Casio fx-CG 10, Casio fx-CG 20, Casio fx-CG 50

Problem with sprintf in miniSDK 1.09

Postby sentaro21 » Tue Jan 09, 2018 9:03 am

Hello

I'm using miniSDK 0.9 by development of the C.Basic for CG now.
Because it is the transplant from the C.Basic for FX,
I'm very thankful at all for compatibility with FX-SDK.
And it was impossible without fx-document.
It is very usefull document!
Thanks so very much. :D


By the way,
There is a problem only a little here.
sprintf from the FX-SDK library is slightly strange, :|

(example)

a=0.123
sprintf( buffer,"%e",a);
result of buffer-> 0.123000e+00

a=1.23
sprintf( buffer,"%e",a);
result of buffer-> 0.123000e+01

a=12.3
sprintf( buffer,"%e",a);
result of buffer-> 0.123000e+02


a=0.123
sprintf( buffer,"%f",a);
result of buffer-> 0.123000

a=1.23
sprintf( buffer,"%f",a);
result of buffer-> 01.230000

a=12.3
sprintf( buffer,"%f",a);
result of buffer-> 012.300000


a=0.123
sprintf( buffer,"%g",a);
result of buffer-> 0.123

a=1.23
sprintf( buffer,"%g",a);
result of buffer-> 01.23

a=12.3
sprintf( buffer,"%g",a);
result of buffer-> 012.3


Does this have the possibility that can revise?


and,
Is there the system call for the free space of the storage memory in CG10/20/50?



(---edit---)
I misunderstood the version of mini SDK.
I'm very sorry.
It was 1.09 not 0.9
Last edited by sentaro21 on Thu Jan 11, 2018 10:52 am, edited 2 times in total.


Senior Member
Posts: 109
Joined: Mon Mar 02, 2015 10:53 am
Calculators: Casio fx-CG 20

Re: Problem with sprintf in miniSDK 0.9

Postby AmazoNKA » Wed Jan 10, 2018 10:02 pm

The following worked for me some time ago:
unsigned short smemMedia[7]={'\\','\\','f','l','s','0',0};
int freespace;
Bfile_GetMediaFree_OS( smemMedia, &freespace );// the free space in bytes on the storage memory is now on freespace.

Member
User avatar
Posts: 21
Joined: Mon Oct 27, 2014 1:46 pm
Location: Japan
Calculators: Casio Cfx Series, Casio fx-9860G, Casio fx-9860 GII, Casio fx-9860 GII SD Power Graphic 2, Casio fx-CG 10, Casio fx-CG 20, Casio fx-CG 50

Re: Problem with sprintf in miniSDK 0.9

Postby sentaro21 » Thu Jan 11, 2018 8:16 am

AmazoNKA wrote:The following worked for me some time ago:
unsigned short smemMedia[7]={'\\','\\','f','l','s','0',0};
int freespace;
Bfile_GetMediaFree_OS( smemMedia, &freespace );// the free space in bytes on the storage memory is now on freespace.

It works very well!
Thanks very much! :D

Return to Casio Prizm SDK

Who is online

Users browsing this forum: No registered users and 4 guests