What is a string ? What does it do? How do I use it? What does this mysterious string thing do?
n/a
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
9th June, 2003 at 05:18:52 -
StringComputer Science - A set of consecutive characters.
A string is just a string of characters. In other words (lol words) text. So what i am typing now could be defined as a string of characters or more simply a string. You can change a string's alterable string, so that what it says changes.
i.e
Start of frame - String.Alterable string = "hello"
Then the string will change to say "hello". They can be simply used to communicate with the user of your program, or for more complex programming in which you need to store data for later use and such.
It makes more sense when you think about how computers first 'evolved', and how they work.
Your computer has pretty much just one basic way of storing data: Bytes (there are variations on this, but that's pretty much it). A byte can hold a number between 0 and 255 (usually), but people wanted to use *text* on computers, not just numbers. Various methods were developed, but the one that is most widely used today is ASCII, or 'American Standard Code for Information Interchange'.
The way it worked was that every character in the alphabet (as well as a few commands, such as delete, carriage return, line feed, tab, and so on) was given a number (between 0 and 255 - see the connection?). That value was then assigned to a standard byte, and voila! You get what we now know as 'Plain Text', or Notepad's good ol' .txt file.
All text is, you see, is a 'string' of bytes one after the other. The expression makes perfect sense when you think of it this way (or at least I hope it does).
There are plenty of old-fashioned words still used in computers today. Another example is 'print', from way back in the days before computers had monitors, and data was litterally printed out onto paper rather than appearing on a screen.
----
However, I'm guessing you want to know what the 'String Object' is, not just what the term 'String' means. As you can guess from the name, it is a text thing. Its sole purpose is to be able to display text. You can give it multiple paragraphs, and switch between paragraphs in-game.
You can also use its 'alterable string', which can be changed at any time during the game. The string object can use fonts and text colour, but it is only plain text, so you can't make some words bold and others not.
It's often used for the speech in games. Any text that you don't want the user to edit manually can be done using this.
so is a string basically a piece of text that can be editied from the event editor? so could I use this in an rpg type game with lots of text? or should I use the normal text object??
n/a
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
10th June, 2003 at 01:13:40 -
Yep that's basically it. You can use it in an rpg to do that. But for rpgs it's best when combined with an ini or something. Check my example under muz's question, about conversation editors.