BS>Can anybody explain the following ? (code has been simplified) ...
BS>Delphi Version 1.0 (raw). Platform, W95.
BS>var
BS> tch : char ; s : strings ;
BS>begin
BS> tch := 'A' ;
BS>{ then use either }
BS> s := tch ;
BS> ShowMessage('Drive '+ s + ':') ; { works OK, no problem }
BS>{ or ... }
BS> ShowMessage('Drive '+ tch + ':') ; { problems ! }
BS>The second causes a GPF somewhat later in the code while traversing a
BS>pointer structure. It seems that you can not "plus" a character into a
BS>string for ShowMessage, though I have "plussed" character variables into
BS>strings millions of times in the past.
You might try casting the character as a string... I suspect (though I
could be wrong, as I am just guessing), that the problem lies in how
strings are sent to API functions. They are generally converted to null
terminated strings. "Adding" a char might mess that up...
---
þ QMPro 1.52 þ This message can be seen only on Pay-Per-View!
---------------
* Origin: FidoNet þ GC-BBS! þ 614-871-0613 (1:226/810)
|