Delphi 10.2 How do I get Log.d to ignore % in the HTML source code?
How do I get Log.d
to ignore %
in the HTML source code? Or tell Log.d
not to format the code?
The HTML code I send to my program:
<input type="hidden" name="Mode" value="Search%20Statutes" />
The procedure I created:
procedure ThtmlParser.DebugText(ExtraStr, Str: string);
var
CombineStrings: string;
begin
CombineStrings := ExtraStr + Str;
Log.d(CombineStrings);
if Assigned(FOnDebug) then
begin
FOnDebug(CombineStrings);
end;
end;
How I use it:
Target := '<input type="hidden" name="Mode" value="Search%20Statutes" />'
DebugText('Target: ', Target);
The error I'm getting:
First chance exception at $756C1812. Exception class EConvertError with message 'No argument for format 'Target: <input type="hidden" na''. Process htmlParserExample.exe (5168)
What I think is happening, that Log.d
thinks the %
in the HTML code is for formating when it is not.
delphi format arguments firemonkey delphi-10.2-tokyo
|
show 1 more comment
How do I get Log.d
to ignore %
in the HTML source code? Or tell Log.d
not to format the code?
The HTML code I send to my program:
<input type="hidden" name="Mode" value="Search%20Statutes" />
The procedure I created:
procedure ThtmlParser.DebugText(ExtraStr, Str: string);
var
CombineStrings: string;
begin
CombineStrings := ExtraStr + Str;
Log.d(CombineStrings);
if Assigned(FOnDebug) then
begin
FOnDebug(CombineStrings);
end;
end;
How I use it:
Target := '<input type="hidden" name="Mode" value="Search%20Statutes" />'
DebugText('Target: ', Target);
The error I'm getting:
First chance exception at $756C1812. Exception class EConvertError with message 'No argument for format 'Target: <input type="hidden" na''. Process htmlParserExample.exe (5168)
What I think is happening, that Log.d
thinks the %
in the HTML code is for formating when it is not.
delphi format arguments firemonkey delphi-10.2-tokyo
Where is the rest of ThtmlParser declared? What is the declaration of log.d?
– MartynA
Jan 1 at 17:47
@MartynA Log.d is in FMX.Types
– Dave Nottage
Jan 1 at 21:06
2
@DaveNottage: But how are readers supposed to guess that that's what the OP is referring to? There isn't even a FireMonkey tag on the q.
– MartynA
Jan 1 at 21:12
@MartynA log.d is accessible to VCL projects as well, despite being in FMX.Types!
– Pat Heuvel
Jan 2 at 8:48
@PatHeuvel: Yes, but readers shouldn't have to guess whether that is te log.d the OP intended; the information should be in the q.
– MartynA
Jan 2 at 9:06
|
show 1 more comment
How do I get Log.d
to ignore %
in the HTML source code? Or tell Log.d
not to format the code?
The HTML code I send to my program:
<input type="hidden" name="Mode" value="Search%20Statutes" />
The procedure I created:
procedure ThtmlParser.DebugText(ExtraStr, Str: string);
var
CombineStrings: string;
begin
CombineStrings := ExtraStr + Str;
Log.d(CombineStrings);
if Assigned(FOnDebug) then
begin
FOnDebug(CombineStrings);
end;
end;
How I use it:
Target := '<input type="hidden" name="Mode" value="Search%20Statutes" />'
DebugText('Target: ', Target);
The error I'm getting:
First chance exception at $756C1812. Exception class EConvertError with message 'No argument for format 'Target: <input type="hidden" na''. Process htmlParserExample.exe (5168)
What I think is happening, that Log.d
thinks the %
in the HTML code is for formating when it is not.
delphi format arguments firemonkey delphi-10.2-tokyo
How do I get Log.d
to ignore %
in the HTML source code? Or tell Log.d
not to format the code?
The HTML code I send to my program:
<input type="hidden" name="Mode" value="Search%20Statutes" />
The procedure I created:
procedure ThtmlParser.DebugText(ExtraStr, Str: string);
var
CombineStrings: string;
begin
CombineStrings := ExtraStr + Str;
Log.d(CombineStrings);
if Assigned(FOnDebug) then
begin
FOnDebug(CombineStrings);
end;
end;
How I use it:
Target := '<input type="hidden" name="Mode" value="Search%20Statutes" />'
DebugText('Target: ', Target);
The error I'm getting:
First chance exception at $756C1812. Exception class EConvertError with message 'No argument for format 'Target: <input type="hidden" na''. Process htmlParserExample.exe (5168)
What I think is happening, that Log.d
thinks the %
in the HTML code is for formating when it is not.
delphi format arguments firemonkey delphi-10.2-tokyo
delphi format arguments firemonkey delphi-10.2-tokyo
edited Jan 2 at 0:10
Remy Lebeau
339k19263458
339k19263458
asked Jan 1 at 17:33


El DiabloEl Diablo
276
276
Where is the rest of ThtmlParser declared? What is the declaration of log.d?
– MartynA
Jan 1 at 17:47
@MartynA Log.d is in FMX.Types
– Dave Nottage
Jan 1 at 21:06
2
@DaveNottage: But how are readers supposed to guess that that's what the OP is referring to? There isn't even a FireMonkey tag on the q.
– MartynA
Jan 1 at 21:12
@MartynA log.d is accessible to VCL projects as well, despite being in FMX.Types!
– Pat Heuvel
Jan 2 at 8:48
@PatHeuvel: Yes, but readers shouldn't have to guess whether that is te log.d the OP intended; the information should be in the q.
– MartynA
Jan 2 at 9:06
|
show 1 more comment
Where is the rest of ThtmlParser declared? What is the declaration of log.d?
– MartynA
Jan 1 at 17:47
@MartynA Log.d is in FMX.Types
– Dave Nottage
Jan 1 at 21:06
2
@DaveNottage: But how are readers supposed to guess that that's what the OP is referring to? There isn't even a FireMonkey tag on the q.
– MartynA
Jan 1 at 21:12
@MartynA log.d is accessible to VCL projects as well, despite being in FMX.Types!
– Pat Heuvel
Jan 2 at 8:48
@PatHeuvel: Yes, but readers shouldn't have to guess whether that is te log.d the OP intended; the information should be in the q.
– MartynA
Jan 2 at 9:06
Where is the rest of ThtmlParser declared? What is the declaration of log.d?
– MartynA
Jan 1 at 17:47
Where is the rest of ThtmlParser declared? What is the declaration of log.d?
– MartynA
Jan 1 at 17:47
@MartynA Log.d is in FMX.Types
– Dave Nottage
Jan 1 at 21:06
@MartynA Log.d is in FMX.Types
– Dave Nottage
Jan 1 at 21:06
2
2
@DaveNottage: But how are readers supposed to guess that that's what the OP is referring to? There isn't even a FireMonkey tag on the q.
– MartynA
Jan 1 at 21:12
@DaveNottage: But how are readers supposed to guess that that's what the OP is referring to? There isn't even a FireMonkey tag on the q.
– MartynA
Jan 1 at 21:12
@MartynA log.d is accessible to VCL projects as well, despite being in FMX.Types!
– Pat Heuvel
Jan 2 at 8:48
@MartynA log.d is accessible to VCL projects as well, despite being in FMX.Types!
– Pat Heuvel
Jan 2 at 8:48
@PatHeuvel: Yes, but readers shouldn't have to guess whether that is te log.d the OP intended; the information should be in the q.
– MartynA
Jan 2 at 9:06
@PatHeuvel: Yes, but readers shouldn't have to guess whether that is te log.d the OP intended; the information should be in the q.
– MartynA
Jan 2 at 9:06
|
show 1 more comment
1 Answer
1
active
oldest
votes
Since Delphi is "looking for a format", I gave it a format to follow.
I am not sure why Delphi's developing team would create a class procedure d(const Msg: string); overload; inline;
and not let us use it? That is what got me confused. So instead, I used this instead:
class procedure d(const Fmt: string; const Args: array of const); overload;
Here is my new procedure that fixes my issue:
procedure ThtmlParser.DebugText(ExtraStr, Str: string);
var
CombineStrings: string;
begin
CombineStrings := ExtraStr + Str;
Log.d('%s',[CombineStrings]);
if Assigned(FOnDebug) then
begin
FOnDebug(CombineStrings);
end;
end;
2
I would useLog.d('%s%s', [ExtraStr, Str])
instead, and get rid ofCombineStrings
. You should also file a bug report about the single-argument version ofLog.d()
misbehaving. It should not be formatting anything.
– Remy Lebeau
Jan 2 at 0:07
2
@Remy, ElDiablo:Log.d(Msg)
seems to callLog.d(Msg, );
. That is a mistake, indeed. It should be the other way around. Or it could callLog.d('%s', [Msg]);
. That would be fine.
– Rudy Velthuis
Jan 2 at 7:48
Reported it: quality.embarcadero.com/browse/RSP-23171
– Rudy Velthuis
Jan 2 at 12:15
Was just notified that my report was a duplicate of quality.embarcadero.com/browse/RSP-20021 and that this is resolved in Delphi 10.3 Rio.
– Rudy Velthuis
Jan 2 at 15:46
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53997527%2fdelphi-10-2-how-do-i-get-log-d-to-ignore-in-the-html-source-code%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Since Delphi is "looking for a format", I gave it a format to follow.
I am not sure why Delphi's developing team would create a class procedure d(const Msg: string); overload; inline;
and not let us use it? That is what got me confused. So instead, I used this instead:
class procedure d(const Fmt: string; const Args: array of const); overload;
Here is my new procedure that fixes my issue:
procedure ThtmlParser.DebugText(ExtraStr, Str: string);
var
CombineStrings: string;
begin
CombineStrings := ExtraStr + Str;
Log.d('%s',[CombineStrings]);
if Assigned(FOnDebug) then
begin
FOnDebug(CombineStrings);
end;
end;
2
I would useLog.d('%s%s', [ExtraStr, Str])
instead, and get rid ofCombineStrings
. You should also file a bug report about the single-argument version ofLog.d()
misbehaving. It should not be formatting anything.
– Remy Lebeau
Jan 2 at 0:07
2
@Remy, ElDiablo:Log.d(Msg)
seems to callLog.d(Msg, );
. That is a mistake, indeed. It should be the other way around. Or it could callLog.d('%s', [Msg]);
. That would be fine.
– Rudy Velthuis
Jan 2 at 7:48
Reported it: quality.embarcadero.com/browse/RSP-23171
– Rudy Velthuis
Jan 2 at 12:15
Was just notified that my report was a duplicate of quality.embarcadero.com/browse/RSP-20021 and that this is resolved in Delphi 10.3 Rio.
– Rudy Velthuis
Jan 2 at 15:46
add a comment |
Since Delphi is "looking for a format", I gave it a format to follow.
I am not sure why Delphi's developing team would create a class procedure d(const Msg: string); overload; inline;
and not let us use it? That is what got me confused. So instead, I used this instead:
class procedure d(const Fmt: string; const Args: array of const); overload;
Here is my new procedure that fixes my issue:
procedure ThtmlParser.DebugText(ExtraStr, Str: string);
var
CombineStrings: string;
begin
CombineStrings := ExtraStr + Str;
Log.d('%s',[CombineStrings]);
if Assigned(FOnDebug) then
begin
FOnDebug(CombineStrings);
end;
end;
2
I would useLog.d('%s%s', [ExtraStr, Str])
instead, and get rid ofCombineStrings
. You should also file a bug report about the single-argument version ofLog.d()
misbehaving. It should not be formatting anything.
– Remy Lebeau
Jan 2 at 0:07
2
@Remy, ElDiablo:Log.d(Msg)
seems to callLog.d(Msg, );
. That is a mistake, indeed. It should be the other way around. Or it could callLog.d('%s', [Msg]);
. That would be fine.
– Rudy Velthuis
Jan 2 at 7:48
Reported it: quality.embarcadero.com/browse/RSP-23171
– Rudy Velthuis
Jan 2 at 12:15
Was just notified that my report was a duplicate of quality.embarcadero.com/browse/RSP-20021 and that this is resolved in Delphi 10.3 Rio.
– Rudy Velthuis
Jan 2 at 15:46
add a comment |
Since Delphi is "looking for a format", I gave it a format to follow.
I am not sure why Delphi's developing team would create a class procedure d(const Msg: string); overload; inline;
and not let us use it? That is what got me confused. So instead, I used this instead:
class procedure d(const Fmt: string; const Args: array of const); overload;
Here is my new procedure that fixes my issue:
procedure ThtmlParser.DebugText(ExtraStr, Str: string);
var
CombineStrings: string;
begin
CombineStrings := ExtraStr + Str;
Log.d('%s',[CombineStrings]);
if Assigned(FOnDebug) then
begin
FOnDebug(CombineStrings);
end;
end;
Since Delphi is "looking for a format", I gave it a format to follow.
I am not sure why Delphi's developing team would create a class procedure d(const Msg: string); overload; inline;
and not let us use it? That is what got me confused. So instead, I used this instead:
class procedure d(const Fmt: string; const Args: array of const); overload;
Here is my new procedure that fixes my issue:
procedure ThtmlParser.DebugText(ExtraStr, Str: string);
var
CombineStrings: string;
begin
CombineStrings := ExtraStr + Str;
Log.d('%s',[CombineStrings]);
if Assigned(FOnDebug) then
begin
FOnDebug(CombineStrings);
end;
end;
edited Jan 2 at 0:06
Remy Lebeau
339k19263458
339k19263458
answered Jan 1 at 17:47


El DiabloEl Diablo
276
276
2
I would useLog.d('%s%s', [ExtraStr, Str])
instead, and get rid ofCombineStrings
. You should also file a bug report about the single-argument version ofLog.d()
misbehaving. It should not be formatting anything.
– Remy Lebeau
Jan 2 at 0:07
2
@Remy, ElDiablo:Log.d(Msg)
seems to callLog.d(Msg, );
. That is a mistake, indeed. It should be the other way around. Or it could callLog.d('%s', [Msg]);
. That would be fine.
– Rudy Velthuis
Jan 2 at 7:48
Reported it: quality.embarcadero.com/browse/RSP-23171
– Rudy Velthuis
Jan 2 at 12:15
Was just notified that my report was a duplicate of quality.embarcadero.com/browse/RSP-20021 and that this is resolved in Delphi 10.3 Rio.
– Rudy Velthuis
Jan 2 at 15:46
add a comment |
2
I would useLog.d('%s%s', [ExtraStr, Str])
instead, and get rid ofCombineStrings
. You should also file a bug report about the single-argument version ofLog.d()
misbehaving. It should not be formatting anything.
– Remy Lebeau
Jan 2 at 0:07
2
@Remy, ElDiablo:Log.d(Msg)
seems to callLog.d(Msg, );
. That is a mistake, indeed. It should be the other way around. Or it could callLog.d('%s', [Msg]);
. That would be fine.
– Rudy Velthuis
Jan 2 at 7:48
Reported it: quality.embarcadero.com/browse/RSP-23171
– Rudy Velthuis
Jan 2 at 12:15
Was just notified that my report was a duplicate of quality.embarcadero.com/browse/RSP-20021 and that this is resolved in Delphi 10.3 Rio.
– Rudy Velthuis
Jan 2 at 15:46
2
2
I would use
Log.d('%s%s', [ExtraStr, Str])
instead, and get rid of CombineStrings
. You should also file a bug report about the single-argument version of Log.d()
misbehaving. It should not be formatting anything.– Remy Lebeau
Jan 2 at 0:07
I would use
Log.d('%s%s', [ExtraStr, Str])
instead, and get rid of CombineStrings
. You should also file a bug report about the single-argument version of Log.d()
misbehaving. It should not be formatting anything.– Remy Lebeau
Jan 2 at 0:07
2
2
@Remy, ElDiablo:
Log.d(Msg)
seems to call Log.d(Msg, );
. That is a mistake, indeed. It should be the other way around. Or it could call Log.d('%s', [Msg]);
. That would be fine.– Rudy Velthuis
Jan 2 at 7:48
@Remy, ElDiablo:
Log.d(Msg)
seems to call Log.d(Msg, );
. That is a mistake, indeed. It should be the other way around. Or it could call Log.d('%s', [Msg]);
. That would be fine.– Rudy Velthuis
Jan 2 at 7:48
Reported it: quality.embarcadero.com/browse/RSP-23171
– Rudy Velthuis
Jan 2 at 12:15
Reported it: quality.embarcadero.com/browse/RSP-23171
– Rudy Velthuis
Jan 2 at 12:15
Was just notified that my report was a duplicate of quality.embarcadero.com/browse/RSP-20021 and that this is resolved in Delphi 10.3 Rio.
– Rudy Velthuis
Jan 2 at 15:46
Was just notified that my report was a duplicate of quality.embarcadero.com/browse/RSP-20021 and that this is resolved in Delphi 10.3 Rio.
– Rudy Velthuis
Jan 2 at 15:46
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53997527%2fdelphi-10-2-how-do-i-get-log-d-to-ignore-in-the-html-source-code%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Where is the rest of ThtmlParser declared? What is the declaration of log.d?
– MartynA
Jan 1 at 17:47
@MartynA Log.d is in FMX.Types
– Dave Nottage
Jan 1 at 21:06
2
@DaveNottage: But how are readers supposed to guess that that's what the OP is referring to? There isn't even a FireMonkey tag on the q.
– MartynA
Jan 1 at 21:12
@MartynA log.d is accessible to VCL projects as well, despite being in FMX.Types!
– Pat Heuvel
Jan 2 at 8:48
@PatHeuvel: Yes, but readers shouldn't have to guess whether that is te log.d the OP intended; the information should be in the q.
– MartynA
Jan 2 at 9:06