[I6, Glulx] Working with the strings

Good day all!

  1. I know it’s very trivial question, but I can’t figure out how to get the length of string’s variable (not dictionary word, just string in doublequotes) in chars and n-char of it. Are there any built-in routines or I need manipulate with bytes and arrays?

  2. I made custom statusbar (text grid window). It is array, if I correct understood. How can I get the value of n-char of this array?

Getting the length of a string is not a simple operation. You have to print it out and look at the count of printed characters. If you really need to do this, look at the PrintAnyToArray() routine in parserm.h.

To print to a text grid window, switch to it using the set_window() call (or opcode) and then print normally. Look at the way the Box__Routine() routine works, for example.