|
-
January 5th, 2003, 11:34 PM
#1
Who help me with this problem????
I read and write strings using RandomAccessFile and strings in
my file are just as follow:
string1/n
string2/n
...
stringn/n
For example, when I read string2 from file and the length of string2 is 4. Now I add or remove something to the string and the length become more or less, then I save it. But when I read it
from file again, I find it's changed.
string1/n
string21/n
string22/n
...
stringn/n
-
January 6th, 2003, 07:25 AM
#2
Can you try explaining what the problem is a bit more clearly?
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
January 6th, 2003, 10:03 AM
#3
Sorry. My English is poor
-
January 6th, 2003, 06:58 PM
#4
I think your English is good enough, but you need to give more details. You say you read the file and the length of a string is 4.
OK. Then you add something to or remove something from the string, so the string length changes, then you save the modified file. OK, so you have changed the file contents, one of the strings is now a different length...
Then you say that when you read the file again, it has changed. What, exactly, has changed? The file has changed, of course - you just changed the contents... Is the string you read in different from the string you wrote out?
What is it that has changed, and why is this change unexpected?
How do the file contents you posted show the problem?
the agressive whine of angry hornets was all around them now...
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
January 7th, 2003, 02:36 AM
#5
For example, the content in the file is:
1234567891/n
apple/n
11/n
11/n
If I changed the string, "apple" into "app", or into "orange", then
the 3rd line and the 4th line also changed.
-
January 7th, 2003, 05:33 AM
#6
You'll have to post the relevant code, because I can't guess what's going wrong from so little information.
Nobody told him it was loaded with live rounds...
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|