Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

QBasic/Working With Strings

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

What are strings and what are they used for? In QBASIC, a string is a contiguous sequence of ASCII encoded characters in memory. The characters are stored in memory as an 8 bit byte. Strings in QBASIC are mutable meaning they can be changed in place without allocating new memory. By now if you have read the prior chapters, you should know that strings are typically used to represent numbers, letters, and other symbols and are used to display information on screen, and getting user input. In the Files chapter you will find that strings can be saved into and read from files as well. If you get creative you can use strings for other purposes. One example is adding large numbers hundreds of digits long. In QBASIC you cannot do that with its built in numeric data types. You could however store the digits in string form and write your own function to add a couple of strings containing digits together thus overcoming some of the initial QBASIC constraints. Functions Character Functions Asc Chr$ String Functions Conversion Lcase$ Str$ Ucase$ Generator Space$ String$ Search InStr Size Of Len Splice Left$ Mid$ Right$ Truncate Ltrim$ Rtrim$ Memory Manipulation Functions Peek Poke SADD Examples