Page 3 of 4
Re: Double-quotes in strings
Posted: Tue Mar 05, 2013 2:13 pm
by Danilo
PMV wrote:Do you have to study communication now?

That's possible! I try to communicate with ordinary humans all day. There are misunderstandings all time,
and this is the reason I try to explain everything word by word. Does it mean I am an alien, coming
from future? For me, it is just normal to re-think everything, to think about every possible outcome and
every possible situation. It is me! Other people seem to think only about themselfs, and what happens
within the next seconds. Don't know, but ordinary people are somewhat boring to me, not archiving anything
and not wanting anything in life... so to be different is not so bad at the end.

Re: Double-quotes in strings
Posted: Tue Mar 05, 2013 2:50 pm
by PMV
Danilo wrote:For me, it is just normal to re-think everything, to think about every possible outcome and
every possible situation. It is me!
I do that, too. Can't say if i do that less then you or more,
but who cares? More important is that we are all humans.
Some are more stupid then others, but everything has there
advantages and disadvantages. Speaking with someone who
has another opinion is sometimes the best way to find a
fresh solution. And it doesn't count how much that one
knows about a specific topic. Especially if you doesn't have
any clue about how much that one really knows. Just
thinking "he has to not know anything" is a bad characteristic
and an ordinary one, too *grins*
MFG PMV
Re: Double-quotes in strings
Posted: Tue Mar 05, 2013 4:17 pm
by Kukulkan
+1 for the ""special"" VB6 notation.
I still would love to have PHP style escape characters but I agree with Danilo that this is not that easy in PB environment as the single quotes having special meaning with characters. So the VB6 style is ok for me and this would be very helpful indeed.
Kukulkan
Re: Double-quotes in strings
Posted: Tue Mar 05, 2013 5:32 pm
by luis
Wow... I certainly see something very ordinary here.
Re: Double-quotes in strings
Posted: Tue Mar 05, 2013 7:29 pm
by Demivec
+1 for the ""special"" VB6 notation.
I am familiar with this notation from the use of ancient BASIC's that had limitations on line length (120 characters). It works well enough to shorten a line instead of using one of the constant notations: +Chr(34)+; +#DQUOTE$+; or +#DQ$+, which add 9, 10, or 6 characters instead of 1 for the solitary double quote. You then realize that they are usually used in pairs +/- a concatenation character, and you get 18, 20, 12, or 2 characters that are required to place a set of double quotes in a string in this manner.
Apart from the savings achieved by using less characters, which in this day and age only refers to convenience and nothing more, I don't see this as a must-have feature. However, even though I would use whatever notation was necessary to place the quotes in the string I would switch immediately to using this if it became available.
I think beginners would find it easy to use as well. They also would have the choice of which they preferred to use, according to their comprehension, and would choose what works well for them.
@Danillo: [Off Topic] It is important to be able to discuss things freely without a pre-requirement that you know anything; that is one of the few things that allows beginners to become experts. The discussion becomes useless when someone thinks that only their opinion is right and then tries to defend it by eliminating those that disagree with them from the discussion. As an expert you may have had discussions with experts where you were considered a beginner, where they could only roll their eyes because you did not know as much as they did; they may also have just been more patient while your understanding matured. Darwin said 'survival of the fittest' and not 'survival of the only'.

[/Off Topic]
Re: Double-quotes in strings
Posted: Wed Mar 06, 2013 6:46 am
by Danilo
Demivec wrote:@Danillo: [Off Topic] It is important to be able to discuss things freely without a pre-requirement that you know anything; that is one of the few things that allows beginners to become experts. The discussion becomes useless when someone thinks that only their opinion is right and then tries to defend it by eliminating those that disagree with them from the discussion. As an expert you may have had discussions with experts where you were considered a beginner, where they could only roll their eyes because you did not know as much as they did; they may also have just been more patient while your understanding matured. Darwin said 'survival of the fittest' and not 'survival of the only'.

[/Off Topic]
PMV and me had a little argument last weekend. It is the reason I thought he wanted to play games with me yesterday, making jokes.
Before PMV's message I answered kindly, I think (Posting "Again, the general idea is good."). After PMV's first posting you see a change
in my postings. I don't blame PMV - I am the problem here.
Re: Double-quotes in strings
Posted: Wed Mar 06, 2013 9:09 am
by Didelphodon
+1 for the ""-version
Re: Double-quotes in strings
Posted: Wed Mar 06, 2013 9:24 am
by Rescator
Re: Double-quotes in strings
Posted: Wed Mar 06, 2013 12:22 pm
by davido
A alternative would be to have a choice of string delimiters such as " ' !
Delimiter$ = !He said: 'She said: "Pure Basic is a great programming language even with a single string delimiter?" if I recall correctly.'!
Re: Double-quotes in strings
Posted: Thu Mar 07, 2013 1:49 am
by VoSs2o0o
+1 for the ""-version
Re: Double-quotes in strings
Posted: Fri Mar 08, 2013 8:01 pm
by RichAlgeni
How about an additional string delimiter, such as the pipe character? For instance:
Now pipe may not be the best character to use, a different character may be better, but this method would make it easier to use double quotes inside a string.
Re: Double-quotes in strings
Posted: Fri Mar 08, 2013 8:35 pm
by BorisTheOld
The defacto standard for many years, in many different languages, has been to use "" to represent a doublequote within a string.
Using other non-tranditional characters, such as two single quotes, or ! , would break a lot of existing code. Even the \n type of escape sequences are probably not a good idea, since they have not been a feature of PB literal strings and could break code.
We do a lot of text manipulation when generating our source code. Except for the "" usage, all the other suggestions would break our code in a big way. We have mega-bytes of code templates full of unusual character sequences, so the last thing we need is for PB to be substituting "random" characters in quoted strings. That would not make me happy a happy programmer.
Re: Double-quotes in strings
Posted: Fri Mar 08, 2013 9:12 pm
by RichAlgeni
BorisTheOld wrote:the last thing we need is for PB to be substituting "random" characters in quoted strings. That would not make me happy a happy programmer.
Boris is apparently a 'glass is half empty' kind of guy. Obviously this wouldn't be a 'random' character, it would need to be defined in someway, so that the compiler knew what it was. I've seen much less sophisticated compilers handle this correctly.
Under this scenario, anything within two of these new delimiters will be considered a string. It would take just a little thought and some intelligent design to utilize correctly. And maybe a glass that is at least half full.
Re: Double-quotes in strings
Posted: Fri Mar 08, 2013 9:33 pm
by ts-soft
I would love escape-sequences with \ and compilerdirectives to enable and disable like:
EnableEscape
DisableEscape
Re: Double-quotes in strings
Posted: Fri Mar 08, 2013 9:42 pm
by Tenaja
ts-soft wrote:I would love escape-sequences with \ and compilerdirectives to enable and disable like:
EnableEscape
DisableEscape
And for those who prefer "random" characters...
EnableEscape "/" ; makes the escape character /
EnableEscape "|" ; makes the escape character |