Semicolon: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:
''Usage:'' COLOR 13: PRINT "Value ="; value1; value2; value3
''Usage:'' COLOR 13: PRINT "Value ="; value1; value2; value3


{{OutputStart}}{{text|1234  5678  9012|magenta}}{{OutputEnd}}
{{OutputStart}}{{Text|1234  5678  9012|magenta}}{{OutputEnd}}




Line 10: Line 10:
* Use the [[WRITE]] statement to print values with only commas between the values and no spacing.
* Use the [[WRITE]] statement to print values with only commas between the values and no spacing.
* A semicolon can append the next print when used at the end of a [[PRINT]] statement.
* A semicolon can append the next print when used at the end of a [[PRINT]] statement.
* Use a semicolon after text that will be [[PRINT|printed]] on the last two text rows of a [[SCREEN (statement)|screen mode]] to prevent screen rolling.
* Use a semicolon after text that will be [[PRINT|printed]] on the last two text rows of a [[SCREEN|screen mode]] to prevent screen rolling.
* [[INPUT]] statements can use the semicolon '''before''' the text to prevent screen rolling. '''INPUT ; "text or question"; variable'''.
* [[INPUT]] statements can use the semicolon '''before''' the text to prevent screen rolling. '''INPUT ; "text or question"; variable'''.
* A semicolon '''after''' the text will create a question mark and space after the [[INPUT]] text question. Use a comma for statements.
* A semicolon '''after''' the text will create a question mark and space after the [[INPUT]] text question. Use a comma for statements.
Line 18: Line 18:




''See also:''
{{PageSeeAlso}}
 
* [[Comma]]
* [[Comma]]
* [[PRINT]], [[PRINT USING]]
* [[PRINT]], [[PRINT USING]]
* [[WRITE]]
* [[WRITE]]
* [[INPUT]], [[LINE INPUT]]
* [[INPUT]], [[LINE INPUT]]
* [[STR$]] {{text|(convert number to string)}}
* [[STR$]]
* [[VAL]] {{text|(convert string to number)}}
* [[VAL]]




{{PageNavigation}}
{{PageNavigation}}

Latest revision as of 22:54, 11 February 2023

The semicolon is used in a PRINT statement to stop the screen print cursor immediately after the printed value.


Usage: COLOR 13: PRINT "Value ="; value1; value2; value3

1234  5678  9012


  • Positive numerical values printed will include a space before and after each value printed. Strings will not have spacing.
  • Use the WRITE statement to print values with only commas between the values and no spacing.
  • A semicolon can append the next print when used at the end of a PRINT statement.
  • Use a semicolon after text that will be printed on the last two text rows of a screen mode to prevent screen rolling.
  • INPUT statements can use the semicolon before the text to prevent screen rolling. INPUT ; "text or question"; variable.
  • A semicolon after the text will create a question mark and space after the INPUT text question. Use a comma for statements.
  • NOTE: Semicolons can NOT be used to combine string variables in a string variable definition!
  • Use the + concatenation operator to combine string variable definition values only!
  • Semicolons cannot be used in or following a WRITE statement!


See also



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