Page 1 of 1

file problem

PostPosted: Thu Sep 28, 2006 11:06 am
by DilloDude
I've encountered a problem with reading from a text-file:
when I have a specific character in a text-file, sub/(substitute), the 26th character of the ascii sequence, it seems to think that the end of file has been reached. I'm reading the character with the fgetc function, and then I'm finding wether the end has been reached with feof. As far as I can figure, it's making feof return a non-zero integer afterwards. Why is this happening, is it likely to happen for other characters and how can it be avoided?

PostPosted: Thu Sep 28, 2006 10:20 pm
by DilloDude
Apparently, the SUB character used to be in some cases an end of file character, so for that reason GE probably thinks it is too. So i've found a work-around to avoid using it.
However, whenever the 226 character is written in a file (using the fputc function), the next character written is the 212 character. So if I say
Code: Select all
fputc(226, file);
fputc(37, file);

it will put a 226 followed by a 212.

PostPosted: Fri Sep 29, 2006 12:56 am
by DilloDude
Also, is there a way I can get a string as a paramater in a function that has more than 255 characters? I've tried a few ways, but they don't seem to work.

PostPosted: Fri Sep 29, 2006 10:03 pm
by makslane
The strings created in the Variables panel have a max lenght of 255.
If you need more, declare your variable in the Global Code editor:

Code: Select all
char mystring[1024];

PostPosted: Tue Oct 03, 2006 2:38 am
by DilloDude
I think the problem I have is with actor texts. The actor text can display texts with more than 255 characters (if you use strcpy or text input), but the actual text variable is only 255 characters. If you are just using strcpy or something, it's alright, because you can use the source rather than the text, but if you are using text input, there isn't really much you can do.
Is there any way I might be able to do a work-around?

PostPosted: Wed Oct 04, 2006 5:42 pm
by makslane
I can't think in a solution now