O'Reilly logo

DarkBASIC Pro Game Programming, Second Edition by Joshua R. Smith, Jonathan S. Harbour

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Programming Strings

Strings are easy to program or define in DarkBASIC. To give you a little perspective, I’ll explain how strings work in most languages. They are more or less a collection of characters. A character, of course, is a number, letter, or punctuation mark. In C you can define a string by creating a character array, whereas in C++ you just define a string class. In DarkBASIC it is much, much easier.

Declaring Strings

So how is a string declared? Simply by encasing what you want to store in the string in quotes (” “). For example, “This sentence is a string.” The quotes tell DarkBASIC to store the text in the string variable. You can declare a string like so:

movie AS STRING

Alternately, you may use the dollar sign to signify that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required