Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Bug Reports / DBP 7.4 - Strings are parsed in a bizarre manner

Author
Message
Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 8th Oct 2009 07:22 Edited at: 8th Oct 2009 07:22
I think this might result from the fact that you are allowed to nest speech marks, but the following certainly can't be intended behaviour:



HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 8th Oct 2009 12:56
seam to me that depending on how many speech marks you have, gives a different result.



Dark Physics makes any hot drink go cold.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Oct 2009 16:34
Can't resist joining in the fun. Try this:



This has to be a bug.
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 8th Oct 2009 18:14 Edited at: 8th Oct 2009 18:39
If I am reading my constant right BAR 123 is a integer and BAR "123" is a string, although when I make one as string it breaks the code.

edit


now I am confused, what should happen when using ""BAR"" ?

Dark Physics makes any hot drink go cold.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Oct 2009 18:46 Edited at: 8th Oct 2009 18:47
Quote: "now I am confused, what should happen when using ""BAR"" ?"


No idea. [Actually, I assume the compiler should replace BAR with whatever follows BAR in its constant definition so #constant BAR 123 should mean that ""BAR"" gets replaced by ""123"" before further compiling occurs. How DBPro interprets that is anyone's guess - and Benjamin guesses (knows?) that it is a string whose value is "123" (i.e. the inner quotes are characters in the string). But I'm guessing now.

But it should be consistent and easily predictable if nothing else - which it plainly isn't.
Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 8th Oct 2009 18:54 Edited at: 8th Oct 2009 18:54
I don't know what DBPro tries to do, but a constant should only replace an identifier with an exact match, which means that if it's in a string or is contained within another identifier, it should be ignored.

I think overall the string parsing (and constant handling) is pretty messed up and I think it needs an overhaul.

Login to post a reply

Server time is: 2026-06-12 09:25:20
Your offset time is: 2026-06-12 09:25:20