Frank D. Engel, Jr. wrote:
I'm not in a position to offer a demo program, and unfortunately, this does not seem to happen in every situation, but here is in essence what
There seems to be a problem with using a function returning a string (maybe just one with no parameters?) directly as an argument to a procedure. Storing the result in a variable then using the variable as the parameter solves the problem.
Could you please send a test program? (I mean program as in something that can be given to the compiler, without "..." and omissions, plus instructions how to invoke it if it expects arguments or interactive input. The usual stuff.)
This may be difficult; the program in which I am experiencing the behavior is quite large, and I am trying to write something more manageable, but the bug is not readily reproduced in the smaller program. It may be a matter of something simple I am missing in the smaller program which triggers the bug, or perhaps it only occurs with programs beyond some minimal size, but I will continue trying. It may take some time though. (the procedures/functions in the existing program are complex and scattered across numerous units, so it may be that the unit structure is playing a part in this too?)
This all may be the case. Just as well it may be a bug in your code (which, e.g. trashes some data which is only seen later). Hard to tell from outside.
All I can say is that I'm using string parameters and results a lot in my own code, also in combination, and I'm not aware of a specific problem like this ...
If it's possible for you, you can sent me the large code, and if I can reproduce the bug under Linux, DJGPP, Solaris or another system I use, I might be able to fix it.
Otherwise, you can wait until GPC gets range-checks (hopefully not too long), which might find the problem if it's an out-of-range access in your code (which is just one possibility, of course).
Frank