October 16, 2021, 01:35:20

Author Topic: How can I pass quotation marks to a string?  (Read 1853 times)

Offline ErikT

  • Jr. Member
  • **
  • Posts: 13
How can I pass quotation marks to a string?
« on: July 17, 2017, 18:47:27 »
... like this here:
Code: [Select]
writeline cfg_xml, "<?xml version="1.0" encoding="UTF-8"?>"
Blitzmax will think I mean to mark the end of the string at "1.0" when I really want those quotation marks to be included in it. There's a way to do this, surely?

Offline TomToad

  • Hero Member
  • *****
  • Posts: 556
Re: How can I pass quotation marks to a string?
« Reply #1 on: July 17, 2017, 19:03:24 »
Anyplace you want a quote, just use ~q
Code: [Select]
writeline cfg_xml, "<?xml version=~q1.0~q encoding=~qUTF-8~q?>"
------------------------------------------------
8 rabbits equals 1 rabbyte.

Offline ErikT

  • Jr. Member
  • **
  • Posts: 13
Re: How can I pass quotation marks to a string?
« Reply #2 on: July 17, 2017, 19:11:24 »
Great, thanks! :)

Offline Rooster

  • Sr. Member
  • ****
  • Posts: 358
  • I don't know what this does...
Re: How can I pass quotation marks to a string?
« Reply #3 on: July 17, 2017, 21:20:20 »
I been wondering that myself.
Thanks TomToad. :)

Offline MikeHart

  • Hero Member
  • *****
  • Posts: 816
Re: How can I pass quotation marks to a string?
« Reply #4 on: July 18, 2017, 06:00:25 »
.

Offline xlsior

  • Jr. Member
  • **
  • Posts: 33
Re: How can I pass quotation marks to a string?
« Reply #5 on: July 19, 2017, 05:11:54 »
Alternatively,
Code: [Select]
print "This is a so-called "+chr$(34)+"quote"+chr$(34)

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal