KOS sscanf didn't understand %f

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
Strapping Scherzo
DC Developer
DC Developer
Posts: 2285
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Fri Feb 21, 2003 7:37 am
Location: Chicago, IL
Has thanked: 0
Been thanked: 1 time
Contact:

KOS sscanf didn't understand %f

Post by Strapping Scherzo »

I'm about to try the other equivilents %g and %e but it makes me wonder if the types that printf and scanf understand in KOS is limited. Any word on this?
Image
Ian Micheal
Soul Sold for DCEmu
Soul Sold for DCEmu
Posts: 4865
Joined: Fri Jul 11, 2003 9:56 pm
Has thanked: 2 times
Been thanked: 4 times

Post by Ian Micheal »

Yeah scanf does not work in plain kos.
Dreamcast forever!!!
doragasu
DCEmu Cool Poster
DCEmu Cool Poster
Posts: 1048
Joined: Thu May 16, 2002 5:01 pm
Location: Madrid, Spain
Has thanked: 0
Been thanked: 0

Post by doragasu »

Ian Micheal wrote:Yeah scanf does not work in plain kos.
He isn't trying scanf, he's trying sscanf.
Strapping Scherzo
DC Developer
DC Developer
Posts: 2285
Joined: Fri Feb 21, 2003 7:37 am
Location: Chicago, IL
Has thanked: 0
Been thanked: 1 time
Contact:

Post by Strapping Scherzo »

doragasu wrote:
Ian Micheal wrote:Yeah scanf does not work in plain kos.
He isn't trying scanf, he's trying sscanf.
Exactly. sccanf works great in KOS for the integer format codes like %d and %i. I just get output from my dc-tool console at runtime that says %f, %d, and %e are unknown. Kinda sucks.
Image
Ian Micheal
Soul Sold for DCEmu
Soul Sold for DCEmu
Posts: 4865
Joined: Fri Jul 11, 2003 9:56 pm
Has thanked: 2 times
Been thanked: 4 times

Post by Ian Micheal »

Only parts work it's not complete. Better off not using it.
Dreamcast forever!!!
User avatar
Ender
DCEmu Super Poster
DCEmu Super Poster
Posts: 1314
Joined: Mon Dec 10, 2001 4:01 pm
Location: Canada, first igloo on your left.
Has thanked: 0
Been thanked: 0
Contact:

Post by Ender »

Ian Micheal wrote:Only parts work it's not complete. Better off not using it.
The clock in my car doesn't work. Guess I shouldn't use my car. :roll:
nymus
DC Developer
DC Developer
Posts: 968
Joined: Tue Feb 11, 2003 4:12 pm
Location: In a Dream
Has thanked: 5 times
Been thanked: 6 times

Post by nymus »

^^don't exaggerate. If the minute hand of your clock is not moving, you're better off not using the watch, unless you don't care about hourly differences in your time. Obvously scherzo wants something in particular from his sscanf and it is his place to demand it, as a user. If it doesn't exist, then he will be dissatisfied, whether or not it is a small thing.

Does your food taste different with an extra pinch of salt?
behold the mind
inspired by Dreamcast
User avatar
Ender
DCEmu Super Poster
DCEmu Super Poster
Posts: 1314
Joined: Mon Dec 10, 2001 4:01 pm
Location: Canada, first igloo on your left.
Has thanked: 0
Been thanked: 0
Contact:

Post by Ender »

nymus wrote:^^don't exaggerate. If the minute hand of your clock is not moving, you're better off not using the watch, unless you don't care about hourly differences in your time. Obvously scherzo wants something in particular from his sscanf and it is his place to demand it, as a user. If it doesn't exist, then he will be dissatisfied, whether or not it is a small thing.
To say that a troubleshooting/bugchecking tool should not be used at all because it does not support one particular type of variable is ridiculous (in my mind).
Does your food taste different with an extra pinch of salt?
Depends on the food :)
User avatar
toastman
Iron Fist of Justice
Iron Fist of Justice
Posts: 4933
Joined: Sat Nov 10, 2001 3:08 am
Location: New Orleans
Has thanked: 0
Been thanked: 0
Contact:

Post by toastman »

That and some of us have the wherewithal to fix said problems or work around them.
No signature.
nymus
DC Developer
DC Developer
Posts: 968
Joined: Tue Feb 11, 2003 4:12 pm
Location: In a Dream
Has thanked: 5 times
Been thanked: 6 times

Post by nymus »

c'mon! Avoiding it IS a valid workaround. It could take time to modify/debug a system utility.

There are others you could come up with too. Suggest them please, instead of shooting down the one put forward... especially if you can't provide an alternative.
behold the mind
inspired by Dreamcast
Ian Micheal
Soul Sold for DCEmu
Soul Sold for DCEmu
Posts: 4865
Joined: Fri Jul 11, 2003 9:56 pm
Has thanked: 2 times
Been thanked: 4 times

Post by Ian Micheal »

Bero Gave me this via email one time it's also limted


Code: Select all

int sscanf(const char *str, const char *fmt,...) 
{ 
va_list ap; 
int *pval; 

if (strcmp(fmt,"%x")) { 
exit(-1); 
} 

va_start(ap, fmt); 
pval = va_arg(ap,int*); 
va_end(ap); 

*pval = strtol(str,0,16); 
return 1; 
}
Kos has not supported it from kos1.1.9 and down. And the support for such things are not complete or even working. I have quiet a few work arounds best bet is to. Write your own string parser. Common to know most of libc is uncomplete and does not work like normal at all.

Want an example I can pm you one. But Sccanf and scanf support are limted Dan has not fix them nether have . I have A sccanf lib that uses GPL code from mini lib c which can not be included into kos.

Other then that You do have to write it one's self.


I can provide work arounds and help if you need it.
Dreamcast forever!!!
Post Reply