Code: Select all
Debug "He said ''hello'' to her" ; Outputs -> He said "hello" to her
Code: Select all
Debug "He said "+#DQUOTE$+"hello"+#DQUOTE$+" to her"
Code: Select all
Debug "He said ""hello"" to her"
Code: Select all
Debug "He said ''hello'' to her" ; Outputs -> He said "hello" to her
Code: Select all
Debug "He said "+#DQUOTE$+"hello"+#DQUOTE$+" to her"
Code: Select all
Debug "He said ""hello"" to her"
I didn't know that!We all know we can use DQUOTE$
-1MachineCode wrote:In everyday language you don't use 2 x ' at all
Code: Select all
DatabaseUpdate(myDb, "Update myTable Set myField = '' Where myID = 123")
DatabaseQuery(myDb, "Select * From myTable Where myField <> ''")
-1MachineCode wrote:... but I think it'd be handy that when the compiler sees 2 x ' in a string, it converts them to a DQUOTE$ automatically. In everyday language you don't use 2 x ' at all.
Yes that would be a big problem, plus in SQlite and others 2 x ' are used as an escape to embed a single quote in a query - it's in the SQLite FAQ.Kiffi wrote:the following queries would fail:Code: Select all
DatabaseUpdate(myDb, "Update myTable Set myField = '' Where myID = 123") DatabaseQuery(myDb, "Select * From myTable Where myField <> ''")
+1 for this suggestion by skywalk.skywalk wrote:Just shorten #DQUOTE$ to:
#DQ$ = Chr(34)
It is silly to type or read 8 characters for a " in a string.
MachineCode wrote:Thoughts?
Code: Select all
Macro DQ : +#DOUBLEQUOTE$+ : EndMacro
Debug "He said "DQ"hello"DQ" to her" ; Outputs -> He said "hello" to her
UndefineMacro DQ
;-----------------------------
Macro DQ(s) : #DQUOTE$ + s + #DQUOTE$ : EndMacro
Debug "He said "+DQ("hello")+" to her" ; Outputs -> He said "hello" to her
;-----------------------------
#DQ$ = #DQUOTE$ ; agree, could be shortened in PB resident
Debug "He said "+#DQ$+"hello"+#DQ$+" to her" ; Outputs -> He said "hello" to her
The reason is that most people come to PB, NOT as a "new to programming" user, but as a programmer experienced in another language. As such, there are many features that one may miss from their previous language, and wish for it in PB.Thade wrote:There are many useless "Feature Requests" lately - especially from people which are not really long time users of PB ...
...So what is the reason that lately so many rather new to PB people want to change the Language and want to add all sorts of booze ideas ?
I added this constants to PB, round about 9 or 10 years ago. It is my fault I didn't add the short #DQ$ too. Sorry skywalk for being so stupid!IdeasVacuum wrote:I didn't know that!We all know we can use DQUOTE$
file$ = "C:\\program files\\myprog\\file.ext" ?helpy wrote:I also would use Escape sequences like in C using the back slash!