| View previous topic :: View next topic |
| Author |
Message |
AntiBNI
Joined: 24 Sep 2007 Posts: 15 Location: Planet Earth
|
Posted: Mon Sep 24, 2007 1:23 pm Post subject: sceIoWrite MiltiLine Writing? |
|
|
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. |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Mon Sep 24, 2007 2:46 pm Post subject: Re: sceIoWrite MiltiLine Writing? |
|
|
| 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. |
|
| Back to top |
|
 |
AntiBNI
Joined: 24 Sep 2007 Posts: 15 Location: Planet Earth
|
Posted: Mon Sep 24, 2007 8:34 pm Post subject: |
|
|
| Im on Windows. |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Mon Sep 24, 2007 9:25 pm Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
alexp
Joined: 17 Apr 2007 Posts: 39
|
Posted: Mon Sep 24, 2007 9:29 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
AntiBNI
Joined: 24 Sep 2007 Posts: 15 Location: Planet Earth
|
Posted: Tue Sep 25, 2007 1:33 am Post subject: |
|
|
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? |
|
| Back to top |
|
 |
AntiBNI
Joined: 24 Sep 2007 Posts: 15 Location: Planet Earth
|
Posted: Tue Sep 25, 2007 8:14 am Post subject: |
|
|
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 ^_^ |
|
| Back to top |
|
 |
Smong
Joined: 04 Sep 2007 Posts: 82
|
Posted: Tue Sep 25, 2007 8:24 am Post subject: |
|
|
| 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. _________________ (+[__]%) |
|
| Back to top |
|
 |
AntiBNI
Joined: 24 Sep 2007 Posts: 15 Location: Planet Earth
|
Posted: Tue Sep 25, 2007 8:38 am Post subject: |
|
|
| I'm using pspDebugScreenPrintf,how many rows are?if its not too much to ask ^_^ |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Tue Sep 25, 2007 9:08 am Post subject: |
|
|
| 68 columns by 34 rows I think |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Tue Sep 25, 2007 9:16 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
AntiBNI
Joined: 24 Sep 2007 Posts: 15 Location: Planet Earth
|
Posted: Tue Sep 25, 2007 11:01 am Post subject: |
|
|
Thanks a bunch!^_^
Help is greatly appreciated. |
|
| Back to top |
|
 |
|