Posted: Fri Feb 02, 2007 8:29 am
You're right. I didn't think about that ...freak wrote:So all filenames must be written like this: "C:\\Program Files\\..." brrr!
http://www.purebasic.com
https://www.purebasic.fr/english/
You're right. I didn't think about that ...freak wrote:So all filenames must be written like this: "C:\\Program Files\\..." brrr!
oh, is slash, no backslashtraumatic wrote: lol no, why do you think that?
ts-soft wrote:More coffee please
i hope this version fix it:Chrono Syndrome wrote:2Flype: Khe-khm... Try this: "\\no problems ?"
Code: Select all
Procedure.s EscapeString(string.s)
ReplaceString(string, "", "|", 2)
Protected *c.Character = @string
While *c\c <> 0
If *c\c = '|'
*c + SizeOf(Character)
Select *c\c
Case '|' : *c\c = '\'
Case 'a' : *c\c = 7 ; bel
Case 'b' : *c\c = 8 ; backspace
Case 't' : *c\c = 9 ; Tab
Case 'l' : *c\c = 10 ; linefeed
Case 'f' : *c\c = 12 ; formfeed
Case 'r' : *c\c = 13 ; return
Case 'n' ; carriage return
*c - SizeOf(Character)
*c\c = 13
*c + SizeOf(Character)
*c\c = 10
Case 'q' : *c\c = 34 ; dquote
EndSelect
EndIf
*c + SizeOf(Character)
Wend
ProcedureReturn ReplaceString(string, "|", "")
EndProcedure
Macro esc(string) ; user defined
EscapeString(string)
EndMacro
MessageRequester("", esc("*\tHello\t\t*\n*\tThere!\t\t*"))
MessageRequester("", esc("C:\\Program Files\\PureBasic\"))
MessageRequester("", esc("\qTest in Dquote\q"))
MessageRequester("", esc( "\\no problems ?"))
Code: Select all
OpenConsole()
hf = ReadFile(#PB_Any,"D:/PureBasic/Examples/Sources/2DDrawing.pb")
While Eof(hf) = 0
PrintN(ReadString(hf))
Wend
Input()
CloseConsole()
gogo wrote:Just a question : How do you escape the double-quote (") character ..... This is why it should be done on the compiler side.
Code: Select all
"\q"
Agreed +1Trond wrote:No I don't want it.Code: Select all
msg.s = "Hello" + #CRLF$ + "There!"
Is that #CRFL$ something you defined or pre-defined? And if it's pre-defined, where is the documentation about it and all the other pre-defined things like it? I just did a search of the help file and found nothing.Trond wrote:Code: Select all
msg.s = "Hello" + #CRLF$ + "There!"
#CRLF$ = chr(13) + chr(10)Tipperton wrote:Is that #CRFL$ something you defined or pre-defined? And if it's pre-defined, where is the documentation about it and all the other pre-defined things like it? I just did a search of the help file and found nothing.Trond wrote:Code: Select all
msg.s = "Hello" + #CRLF$ + "There!"
It's predefined. Take a look at the constants tab in the structure viewer.Tipperton wrote:Is that #CRFL$ something you defined or pre-defined? And if it's pre-defined, where is the documentation about it and all the other pre-defined things like it? I just did a search of the help file and found nothing.Trond wrote:Code: Select all
msg.s = "Hello" + #CRLF$ + "There!"
Look at the Table with ASCII-Codes their depending figures in purebasic.chm. In the first column there are named ascii codes (NUL to US), you can use those names as constants (#US) to get the ascii code or as string constants (#US$) to get it as a string... But you're right there is nothing written about that...Tipperton wrote:Is that #CRFL$ something you defined or pre-defined? And if it's pre-defined, where is the documentation about it and all the other pre-defined things like it? I just did a search of the help file and found nothing.Trond wrote:Code: Select all
msg.s = "Hello" + #CRLF$ + "There!"
The manual says that the structure viewer allows you to view all constant that are predefined in PureBasic. Those constants are written in the list of constants. Where else should the be written?Dr. Dri wrote:But you're right there is nothing written about that...Dri