Quote:
Originally Posted by RoaldLarsen
I seems to me that asserting, without sufficient evidence, that a user is wrong about a software problem is to repeat the very same mistake that a user makes by claiming, without sufficent evidence, that the software is at fault.
|
Erm, I tested the
same condition as you stated in your earlier post. Specific data is irrelevent when one is testing underlying
logic.

I mean, you can test your data all day long, but put simply, garbage in equals garbage out. And from looking at your code snippet it's obvious that you never validated your input data structure. Fail to you.
So, now looking beyond mere data, look at my test code again and you will see that it writes to the
same file multiple times in non-sequential order. Is that (logically) what you were trying to do? Yes, it is.
Heck, I didn't even need to run a specific test - all one needs to do is look at the "fuller" Randomised events.cfg file to see the same condition in action (it does exactly what you are trying to do, so is even
further evidence that your problem must be user - so I'm not sure what further evidence I would need in order for it to be considered "sufficient"? Ironically, my evidence is much greater than your simple and repetitive data test).
So...why then would my code work and yours not?
Look at my sample again and compare to yours. You will notice a very fundamental difference. Why? Because I FOLLOWED THE INSTRUCTIONS IN THE FILE HEADER!
And through looking at logic rather than mere data, it took me about 1 second to see the problem with your code and 1 second to fix it...
Code:
[data\Cfg\Basic.cfg]
<snip>
MEDALS_CREW|SunkInPatrolGerman=60000; TONNAGE, GC
TORPEDO_TYPE5|PrototypeYear=1943
[data\Cfg\Commands_en.cfg]
Cmd313|Key0=0x0
[0:data\Cfg\Basic.cfg]
SUBMARINE_AMMO2|ForeTube10=2 ;T2
[data\Cfg\Sim.cfg]
Visual|Detection time=1 ;[s] ;was 0.5
Heck, the instructions even tell you what to do...
Code:
;*Prefix each repeated section name with #: to ensure that the name is unique.
Now, if you
really understood file I/O you would understand why this requirement is necessary.