sceIoWrite MiltiLine Writing?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
AntiBNI
Posts: 15
Joined: Mon Sep 24, 2007 1:15 pm
Location: Planet Earth

sceIoWrite MiltiLine Writing?

Post by AntiBNI »

hmm i have started developing with C++ like 4 days ago and i need to write some text on multiple lines of a text file.

I have tried alot of ways,some one told me that sceioWrite doesn't accept \n
so i tried passing it from sprintf but when i checked the text file it writed the text but in the part where the \n was there was a small square but dint jump to the next line. >_<

Help will be greatly appreciated.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Re: sceIoWrite MiltiLine Writing?

Post by J.F. »

AntiBNI wrote:hmm i have started developing with C++ like 4 days ago and i need to write some text on multiple lines of a text file.

I have tried alot of ways,some one told me that sceioWrite doesn't accept \n
so i tried passing it from sprintf but when i checked the text file it writed the text but in the part where the \n was there was a small square but dint jump to the next line. >_<

Help will be greatly appreciated.
Are you in unix or windows? It makes a difference. If you have to ask how to do line feeds for unix vs windows, you aren't ready for this. Go take some classes, then try again.
AntiBNI
Posts: 15
Joined: Mon Sep 24, 2007 1:15 pm
Location: Planet Earth

Post by AntiBNI »

Im on Windows.
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

AntiBNI wrote:Im on Windows.
Write "\r\n" instead... or alternatively open the text file with a better thing that notepad. (worpad would do it).

I never understood why microsoft didn't make notepad to understand unix text files but they did with wordpad.... oh well, maybe they haven't touched the code of notepad in years :p
alexp
Posts: 39
Joined: Tue Apr 17, 2007 12:06 am

Post by alexp »

on windows a newline should coupled with a carriage return, so use "\r\n". Anyway I recommend that you learn how to program on a normale PC. PSP is a bit complex and not easily debuggable.
AntiBNI
Posts: 15
Joined: Mon Sep 24, 2007 1:15 pm
Location: Planet Earth

Post by AntiBNI »

I tried that the first time but when i saw the text there was multiple lines but they where in the following order:

(X)
"1 blank space"(O)"small squarebox"
"4blank spaces"Trangle

I opened it on Notepad,im in university right now so i can't check it with wordpad or Notepad++.

So,if i put \r\n windows doesn't read it but the psp will,right?
AntiBNI
Posts: 15
Joined: Mon Sep 24, 2007 1:15 pm
Location: Planet Earth

Post by AntiBNI »

I checked with Notepad++ and Word pad and Word pad shows 2small square boxes (Null Spaces) at the beginning of the text.

Notepad++ shows 2 null spaces.

I guess sceIoRead should read them right.

**Out of topic**

I have another question.

i know that the psp has 480 x 272 in pixels but,when i put 240x136,the text doesn't appear because is WAAAY out of the screen.

but when i put 16x16 the text appears allmost at the center of the screen;i need to know the dimensions of the text on screen so i can calculate and put the text in the right place.

Thanks to every one for helping me ^_^
Smong
Posts: 82
Joined: Tue Sep 04, 2007 4:44 am

Post by Smong »

AntiBNI wrote:i know that the psp has 480 x 272 in pixels but,when i put 240x136,the text doesn't appear because is WAAAY out of the screen.

but when i put 16x16 the text appears allmost at the center of the screen;i need to know the dimensions of the text on screen so i can calculate and put the text in the right place.
You haven't told us how you're displaying text. For example pspDebugScreenPrintf, GU, SDL, etc. If it's pspDebugScreenPrintf then the coordinates aren't in pixels, it's in characters, so 0,1 would be the second row.
(+[__]%)
AntiBNI
Posts: 15
Joined: Mon Sep 24, 2007 1:15 pm
Location: Planet Earth

Post by AntiBNI »

I'm using pspDebugScreenPrintf,how many rows are?if its not too much to ask ^_^
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

68 columns by 34 rows I think
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

TyRaNiD wrote:68 columns by 34 rows I think
Yes, that's the figure precisely. I measured that out months ago for stuff I was doing.
AntiBNI
Posts: 15
Joined: Mon Sep 24, 2007 1:15 pm
Location: Planet Earth

Post by AntiBNI »

Thanks a bunch!^_^

Help is greatly appreciated.
Post Reply