> Your example only illustrates perfectly how and when a string constant should be used
In that particular example, yes. But that's not what the idea is limited too. For string building it's superior to constants and involves far less typing.
> My conclusion: you're not even aware that text can be assigned to a constant in PureBasic
You're kidding i hope.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
StringMacro PB
PureBasic
EndStringMacro
MessageRequester("","This PB example was coded in PB")
MessageRequester("", "Leave this idea in the CUPBOARD!")
A good idea? Absolutely not. We need a standard mask for this to be of any use.
A better solution would be to automatically concatenate strings:
well, honestly I would say, leaving out the PLUSes would drastically decrease readability.
in BASIC there have always been PLUSes for String combination,
and their strong advantage is, when you glance at a single doublequote and a plus,
you can see at once wich side is inside the string and wich outside.
Imagine a combination of six partstrings with five variables without pluses - sheer horror.
Maybe people who grew up with other languages than Basic would be happier without pluses - people who grew up with Basic will not.
Kaeru Gaman wrote:well, honestly I would say, leaving out the PLUSes would drastically decrease readability.
[...]
Maybe people who grew up with other languages than Basic would be happier without pluses - people who grew up with Basic will not.
Kaeru Gaman wrote:...
Maybe people who grew up with other languages than Basic would be happier without pluses - people who grew up with Basic will not.
Well put. I think you hit right on the nail with this !
That is really the main argument, both pro and con.
PB Forums : Proof positive that 2 heads (or more...) are better than one
and I'd like to put it as a clear con, because PureBasic in general followes classic Basic conventions,
except some few details like the brackets around the parameters.
Imagine a combination of six partstrings with five variables without pluses - sheer horror.
Only if you don't have syntax highlight.
I highlighted parts of my previous posting for you.
now eliminate the pluses...
First of all, this was about string merging at compile time, with constants. You're using variables. Constants start with a # and use a different colour by default.
And I had to split the long line, but apart from that there's no problem:
One of them is easier to read.