Search found 204 matches

by papayrus
Thu Jan 30, 2014 3:12 pm
Forum: C++ Development
Topic: Covert EOL End of Line from mac to windows.
Replies: 7
Views: 3142

Re: Covert EOL End of Line from mac to windows.

THis is my code it is simple I do not understand what I need to change to make it work globally. wxTextFile tfile; //tfile.Open(_("REV\\rev.ini")); tfile.Open(_("..\\rev.ini")); for (size_t n=0; n < tfile.GetLineCount(); ++n) { wxString &line = tfile.GetLine(n); //wxLogMessag...
by papayrus
Thu Jan 30, 2014 2:52 pm
Forum: C++ Development
Topic: Covert EOL End of Line from mac to windows.
Replies: 7
Views: 3142

Re: Covert EOL End of Line from mac to windows.

If I wanted to make a restore file incase the original file got damaged how can I write a file like that with that many lines? Would I need to use file.AddLine for each and every line of the ini to write it in full?
by papayrus
Thu Jan 30, 2014 2:39 pm
Forum: C++ Development
Topic: Covert EOL End of Line from mac to windows.
Replies: 7
Views: 3142

Re: Covert EOL End of Line from mac to windows.

I have no idea how I would do what you are talking about. I don't know how to not preserve the BOM Marker and I do not know how to treat the file as UTF-8 encoded and also I don't know how to change the characters and use non asci ones. LOL sorry that is all confusing to me of how I could go about d...
by papayrus
Thu Jan 30, 2014 2:22 pm
Forum: C++ Development
Topic: Covert EOL End of Line from mac to windows.
Replies: 7
Views: 3142

Re: Covert EOL End of Line from mac to windows.

I updated to 3.0.0 and have tested it. It works fine as it is as long as I just convert the EOL to Windows so there was no need to convert the encoding actually it just works. I just want to know how I can convert it or do something else that will work with the mac EOL or all 3 globally. ALso I trie...
by papayrus
Thu Jan 30, 2014 10:19 am
Forum: C++ Development
Topic: Covert EOL End of Line from mac to windows.
Replies: 7
Views: 3142

Covert EOL End of Line from mac to windows.

Is there anyway to convert an ini file that has a mac EOL conversion to a windows conversion on the fly with wx other than using a third party program like notepad++. My program cannot read and write the data from the ini file it just deletes all the text in it. It works fine if I use notepad++ to c...
by papayrus
Thu Jan 30, 2014 10:15 am
Forum: C++ Development
Topic: file.write is erasing all text
Replies: 17
Views: 6914

Re: file.write is erasing all text

I just figured it out. I opeend the rev.ini in notpad++ and saw that the EOL Conversion under the edit menu was set to mac so I changed it to windows and saved it and it works fine.
by papayrus
Fri Jan 24, 2014 9:46 am
Forum: C++ Development
Topic: file.write is erasing all text
Replies: 17
Views: 6914

Re: file.write is erasing all text

If I use wxWidgets 3.0 will it work or will I still need to use streams?
by papayrus
Fri Jan 24, 2014 4:50 am
Forum: C++ Development
Topic: file.write is erasing all text
Replies: 17
Views: 6914

Re: file.write is erasing all text

How did you figure out that it is UTF 8 BOM and how can I convert the file? Is it possible to convert the file header and is it possible to convert it vis code in wxwidgets?
by papayrus
Thu Jan 23, 2014 7:16 pm
Forum: C++ Development
Topic: file.write is erasing all text
Replies: 17
Views: 6914

Re: file.write is erasing all text

It says ini is not allowed for attaching so I changed it to .txt. You will have to rename the extension back to .ini.
by papayrus
Thu Jan 23, 2014 6:25 pm
Forum: C++ Development
Topic: file.write is erasing all text
Replies: 17
Views: 6914

Re: file.write is erasing all text

I have no idea what I need to patch my 2.9 wxWidgets or how to patch it. The link you gave looks like it is for 3.0. I will be getting 3.0 up need to find a good tutorial on how to do it with the new code blocks.
by papayrus
Thu Jan 23, 2014 6:09 pm
Forum: C++ Development
Topic: file.write is erasing all text
Replies: 17
Views: 6914

Re: file.write is erasing all text

Using version wxWidgets-2.9.4. It definitly has something to do with the spacing because if I put all the lines together it works fine without any spacing between lines. Problem is I have to work with it the way it is.
by papayrus
Thu Jan 23, 2014 5:11 pm
Forum: C++ Development
Topic: file.write is erasing all text
Replies: 17
Views: 6914

Re: file.write is erasing all text

Here is the difference between the 2 rev.ini files this first one works fine still. [Emulator] # Language - rev emu will automagically load the correct language files. # This can be English, French, Italian, German, Spanish, sChinese, # Korean, Koreana, tChinese, Japanese, Russian, Thai, or Portugeu...
by papayrus
Wed Jan 22, 2014 11:30 pm
Forum: C++ Development
Topic: file.write is erasing all text
Replies: 17
Views: 6914

Re: file.write is erasing all text

OK They do work now it is line 81. I uncommented wxLogMessage( wxT("Line %d: %s"), n, line.c_str()); and it says line 81. I opened it in notepad++ and it shows the last line of text as 81. Line 41 is where PlayerName = is. I don't get it either why does it just erase all the text in the in...
by papayrus
Wed Jan 22, 2014 11:14 pm
Forum: C++ Development
Topic: file.write is erasing all text
Replies: 17
Views: 6914

Re: file.write is erasing all text

PB wrote:I couldn't find any code that could cause the problem you described. Out of curiosity, what number tfile.GetLineCount() returns after tfile.Open() and before tfile.Write() calls?
I do not know and also the log messages don't seem to work.
by papayrus
Wed Jan 22, 2014 7:15 pm
Forum: C++ Development
Topic: file.write is erasing all text
Replies: 17
Views: 6914

file.write is erasing all text

I made this program that changes the player name in an ini file and it was working before but for some reason now whenever I try to write the playername it erases all the text in the file. Here is my code. I also added the rev.ini file. It's not that important it's just a fun project but I would lik...