 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Martin Sedlmair Guest
|
Posted: Fri Sep 10, 2004 11:40 pm Post subject: D5 -> D7 Incompatible Types "String" and "PResStringRec" |
|
|
Hello,
I've updated my D5 to D7. Everything works fine except there's an error in
my exceptions. There's always the error "Incompatible types "String" and
"PResStringRec". What am I doing wrong?
I looked through the Newsgroups but I didn't find a thing about this
problem.
Thanks,
Martin
|
|
| Back to top |
|
 |
Peter Below (TeamB) Guest
|
Posted: Sat Sep 11, 2004 11:05 am Post subject: Re: D5 -> D7 Incompatible Types "String" and "PResStringRec" |
|
|
In article <41423b7d (AT) newsgroups (DOT) borland.com>, Martin Sedlmair wrote:
| Quote: | I've updated my D5 to D7. Everything works fine except there's an error in
my exceptions. There's always the error "Incompatible types "String" and
"PResStringRec". What am I doing wrong?
|
How can we know that without seeing what you are doing? Code, please!
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
|
|
| Back to top |
|
 |
Martin Sedlmair Guest
|
Posted: Sun Sep 12, 2004 4:22 pm Post subject: Re: D5 -> D7 Incompatible Types "String" and "PResStringRec" |
|
|
Sorry Peter, you are right. I could have used a piece of code for this.
My problem was/is that I used a EFOpenError exception like this in Delphi 5:
raise EFOpenError.Create ('TEST');
But this line now shows an error message is given in the Subject:
"Incompatible types "String" and "PResStringRec"
In Delphi 5 it worked but not in Delphi 7. I know that the constructor of
EFOpenError is changed but isn't there an overloaded constructor for
compatibility?
Thanks,.
Martin
"Peter Below (TeamB)" <100113.1101 (AT) compuXXserve (DOT) com> schrieb im Newsbeitrag
news:VA.0000b2bc.00ad4ba2 (AT) nomail (DOT) please...
|
|
| Back to top |
|
 |
Peter Below (TeamB) Guest
|
Posted: Sun Sep 12, 2004 9:10 pm Post subject: Re: D5 -> D7 Incompatible Types "String" and "PResStringRec" |
|
|
In article <414477cd (AT) newsgroups (DOT) borland.com>, Martin Sedlmair wrote:
| Quote: | My problem was/is that I used a EFOpenError exception like this in Delphi 5:
raise EFOpenError.Create ('TEST');
But this line now shows an error message is given in the Subject:
"Incompatible types "String" and "PResStringRec"
In Delphi 5 it worked but not in Delphi 7. I know that the constructor of
EFOpenError is changed but isn't there an overloaded constructor for
compatibility?
|
As it look there isn't. The TException.Create constructor that takes a single
string parameter is not marked as overload, and neither is the modified
version defined in EFileStreamError (which EFOpenError inherits).
If you want to raise the exception with a single string argument you have to
use the CreateFmt constructor:
raise EFOpenError.CreateFmt ('%s',['TEST']);
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|