Quotation mark: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "A '''quotation mark''' delimits the start and end of a literal STRING value. ''Usage:'' string_value$ = "This is a text STRING." * The quotation mark must delimit the ends of a string or text prompt in a PRINT, WRITE, INPUT or LINE INPUT statement. * The IDE may add a missing quotation mark at the end of a statement or function. * LINE INPUT allows quotation marks to be entered as user input. The LINE INPUT (file sta...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
A '''quotation mark''' delimits the start and end of a literal [[STRING]] value.  
A '''quotation mark''' delimits the start and end of a literal [[STRING]] value.




Line 5: Line 5:




* The quotation mark must delimit the ends of a string or text prompt in a [[PRINT]], [[WRITE]], [[INPUT]] or [[LINE INPUT]] statement.  
* The quotation mark must delimit the ends of a string or text prompt in a [[PRINT]], [[WRITE]], [[INPUT]] or [[LINE INPUT]] statement.
* The IDE may add  a missing quotation mark at the end of a [[SUB|statement]] or [[FUNCTION|function]].  
* The IDE may add  a missing quotation mark at the end of a [[SUB|statement]] or [[FUNCTION|function]].
* [[LINE INPUT]] allows quotation marks to be entered as user input. The [[LINE INPUT (file statement)]] can transfer quotation marks.
* [[LINE INPUT]] allows quotation marks to be entered as user input. The [[LINE INPUT (file statement)]] can transfer quotation marks.
* Quotation marks should be used when [[comma]]s are used in a literal [[WRITE]] or [[INPUT (file statement)]] text string.  
* Quotation marks should be used when [[comma]]s are used in a literal [[WRITE]] or [[INPUT (file statement)]] text string.
* To insert quotation marks in a [[PRINT]] statement insert [[CHR$]](34) using string [[concatenation]] or [[semicolon]]s.
* To insert quotation marks in a [[PRINT]] statement insert [[CHR$]](34) using string [[concatenation]] or [[semicolon]]s.
* String values can be [[concatenation|concatenated]] or added using the plus ([[+]]) operator. Cannot be used to combine numerical values!
* String values can be [[concatenation|concatenated]] or added using the plus ([[+]]) operator. Cannot be used to combine numerical values!
Line 16: Line 16:




''See also:''
{{PageSeeAlso}}
 
* [[STRING]], [[PRINT]], [[WRITE]]
* [[STRING]], [[PRINT]], [[WRITE]]
* [[CHR$]], [[LINE INPUT]]
* [[CHR$]], [[LINE INPUT]]

Latest revision as of 00:58, 29 January 2023

A quotation mark delimits the start and end of a literal STRING value.


Usage: string_value$ = "This is a text STRING."


  • The quotation mark must delimit the ends of a string or text prompt in a PRINT, WRITE, INPUT or LINE INPUT statement.
  • The IDE may add a missing quotation mark at the end of a statement or function.
  • LINE INPUT allows quotation marks to be entered as user input. The LINE INPUT (file statement) can transfer quotation marks.
  • Quotation marks should be used when commas are used in a literal WRITE or INPUT (file statement) text string.
  • To insert quotation marks in a PRINT statement insert CHR$(34) using string concatenation or semicolons.
  • String values can be concatenated or added using the plus (+) operator. Cannot be used to combine numerical values!
  • Concatenation MUST be used when combining literal string values in a variable definition.
  • String values can be combined with other string or numerical values using semicolons or comma tabs in a PRINT statement.
  • Literal DATA strings do not require quotation marks unless the value is a keyword, uses commas or has end spaces.


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link