mcmahling
asked on
Incompatible Types
I am using the call to application.messagebox to show a message when I run a syntac check the first calls below clear the syntac check but the third promotes the error "Incompatible types: String and PAnsiChar." The cursor blinks after the first string argument. Does anyone know why I am getting this error?
1. application.MessageBox('He llo','Hell o',mb_ok);
2. Application.MessageBox('Yo u should try to finish'
+ ' the application normally.'#13#13'øTerminat e it '
+ 'anyway?', 'Warning', MB_YESNO + MB_DEFBUTTON2 +
MB_ICONQUESTION + MB_TASKMODAL);
3. if Application.MessageBox('Ar e you sure you want to delete version ' + intToStr(intVersion) + '?' , 'Question' , mb_YesNo) = ID_Yes then
begin
end;
1. application.MessageBox('He
2. Application.MessageBox('Yo
+ ' the application normally.'#13#13'øTerminat
+ 'anyway?', 'Warning', MB_YESNO + MB_DEFBUTTON2 +
MB_ICONQUESTION + MB_TASKMODAL);
3. if Application.MessageBox('Ar
begin
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Wow!
I just missed 250 points :-)
...Shu
I just missed 250 points :-)
...Shu
i too, shu :-))
no guys, the points are going to kretzschmar,
cause i've learned the unswer from him not long ago (for 50 points :).
regards,
odissey1
cause i've learned the unswer from him not long ago (for 50 points :).
regards,
odissey1
no no, odissey, you are first -> you deserve the points ;-)
:)
I'd also suggest using resourcestrings and Format
so you'd have smtn like:
resourcestring
RSConfirmDeleteVersion = 'Are you sure you want to delete version %d';
RSConfirmation = 'Cofirmation';
...
Application.MessageBox(PCh ar(Format( RSConfirmD eleteVersi on, [VersionNo]), PChar(RSConfirmation), MB_ICONQUESTION or MB_YESNO)
:)
I'd also suggest using resourcestrings and Format
so you'd have smtn like:
resourcestring
RSConfirmDeleteVersion = 'Are you sure you want to delete version %d';
RSConfirmation = 'Cofirmation';
...
Application.MessageBox(PCh
:)
Don't make such a lot of code.
Use:
if MessageDLG('Are you sure?'+#13+'(Yes;No)', mtConfirmation, [mbYes, mbNo], 0)=mrYes then
begin
......
end;
Use:
if MessageDLG('Are you sure?'+#13+'(Yes;No)', mtConfirmation, [mbYes, mbNo], 0)=mrYes then
begin
......
end;
--------------
To "kretzschmar"
__________
Please, read e-mail.
__________
To "kretzschmar"
__________
Please, read e-mail.
__________
thespian .. bleh .. 'coder'
think in advance and more flexibly ..
think in advance and more flexibly ..
to thespian,
what eMail?
to mcmahling,
are you sure that my grading was not a mistake?
(because i attached no new information to odisseys comment)
meikl ;-)
what eMail?
to mcmahling,
are you sure that my grading was not a mistake?
(because i attached no new information to odisseys comment)
meikl ;-)
ASKER
Hello kretzscmar,
I intend to give you 250 points.
I intend to give you 250 points.
to kretzschmar,
you are graded right. The Q. was: '.. anyone know WHY I am getting this..'. But, honestly, I didn't know why - I know HOWTO.
sincerely,
odissey1
you are graded right. The Q. was: '.. anyone know WHY I am getting this..'. But, honestly, I didn't know why - I know HOWTO.
sincerely,
odissey1
well, ok then,
thanks :-))
glad to be helpful
meikl ;-)
thanks :-))
glad to be helpful
meikl ;-)
To kretzschmar
________________
Check e-mail.
Several days ago I wrote a letter from Ukraine.
________________
Check e-mail.
Several days ago I wrote a letter from Ukraine.
thespian,
i got it
i got it
if it wants a character, gie it a character
S:='Are you sure you want to delete version ' + intToStr(3) + '?';
if Application.MessageBox( PChar(S) , 'Question' , mb_YesNo) = ID_Yes then
begin
end;
regards,
odissey1