Lackey
(Daniel Lackey)
May 25, 2020, 4:09pm
1
Hey! I’m I need to measure the length of a string in table in Inform 7 for Glulx. In the following example
Table of examples
Order Name
1 “Fulvio Schiavone”
2 “Dahlia el-Baz”
I need something to determine for me that the length of the name string corresponding to order number 1 is 16, order number 2 is 13, etc.
Can’t seem to figure it out.
Thanks!
Lackey
1 Like
zarf
(Andrew Plotkin)
May 25, 2020, 6:41pm
2
There’s no built-in phrase for this, but you can define one pretty easily:
To decide what number is the character length of (T - text): (- TEXT_TY_CharacterLength({T}) -).
2 Likes
jrb
May 27, 2020, 10:16am
4
Doesn’t “the number of characters in T” do this?
3 Likes
zarf
(Andrew Plotkin)
May 27, 2020, 3:12pm
5
Oh, heh. You’re quite right. I was searching the Standard Rules for a definition of TEXT_TY_CharacterLength
, but I missed that one – it uses a different I6 call which winds up doing the same thing.
Thanks.