• String.Char
    7 replies, posted
String.char's, how are they used and what do they do? I read this, [url]http://wiki.garrysmod.com/?title=String.char[/url] but it didn't really clarify it.
Good question.
Every character has a corresponding byte value (a number in the range 0-255). string.char converts this number into a character. string.byte does the opposite.
According to the example, you can see the numerical equivalent (in the string library) of each character. For example, ABC = (65, 66, 67). I know left mouse click is 107 and right mouse click is 108. This is used for things like SWEP attack function definitions, and perhaps some encoding/decoding stuff.
[QUOTE=Nevec;23818939]Every character has a corresponding byte value (a number in the range 0-255). string.char converts this number into a character. string.byte does the opposite.[/QUOTE] Where can I find the corresponding byte value?
[QUOTE=Nevec;23818939]string.byte does the opposite.[/QUOTE]
[QUOTE=Aide;23819245][/QUOTE] What do you mean?
[QUOTE=erie1555;23820094]What do you mean?[/QUOTE] print(string.byte("a")) Alternatively: [img]http://www.papuaweb.org/info/tek/ascii-000-127.gif[/img]
Sorry, you need to Log In to post a reply to this thread.