Inform6: Can't find BlkValueExtent and BlkValueSetExtent

I’m getting the following errors when using old code containing BlkValueExtent and BlkValueSetExtent and wonder if they’ve been deprecated.
If so, what’s the recommended fix?

Line 36606 # Error: No such constant as “BlkValueExtent”
Line 36607 # Error: No such constant as “BlkValueSetExtent”

Here is the code segment that I’m trying to compile:

[code]To decide which indexed text is rot13 of (T - indexed text): (- (IT_ROT13({-pointer-to-new:indexed text}, {-pointer-to:T})) -).

Include (-

[ IT_ROT13 dest src len i c;
len = BlkValueExtent(src);
BlkValueSetExtent(dest, len);
for (i=0: i<len: i++) {
c = BlkValueRead(src, i);
switch © {
‘a’ to ‘m’, ‘A’ to ‘M’: c = c + 13;
‘n’ to ‘z’, ‘N’ to ‘Z’: c = c - 13;
}
BlkValueWrite(dest, i, c);
}
return dest;
];

-).
[/code]

They’ve been renamed to FlexSize and FlexTotalSize.

Just making that change doesn’t mean your code will work, though. You’d want to figure out the correct handling of text objects at the I6 level – it’s different in the new system.

Ah…
A long time ago, I used to code complete adventures in Inform6.
The code didn’t look as if it was incorrect … as far as I remembered it.
I had a feeling that something had changed, but was sure just what it was.

Well…
Now for the obvious question…
Is there a particular section that I should read in order to get a feel for the new text handling paradigm?
Are there other areas of the documentation that you think might be helpful?
I ask, only because the documentation can be a bit daunting, unless you know what you are looking for.

I don’t know, I don’t understand the new I6 level for text myself. It won’t be in the documentation – that’s for the I7 language.

In general look for the code of something similar and base it off that. For Glulx Text Effects I needed to access the characters of a text, but not to permanently change them. This was similar to checking the character count of a text, so I looked up TEXT_TY_CharacterLength() in Text.i6t to see that I would have to use the TEXT_TY_Temporarily_Transmute() and TEXT_TY_Untransmute functions(): github.com/i7/extensions/blob/m … s.i7x#L154

You want to copy and modify a text, which is kind of like changing the case of a text. So you’ll want a phrase definition of something like this:

To decide what text is the rot13 of (T - text): (- IT_ROT13({-new:text}, {-by-reference:T}, 0) -).

If you look at the source for TEXT_TY_CharactersToCase() you’ll see that you again need to temporarily transmute the old text, but permanently transmute the new text using TEXT_TY_Transmute(). But keep it simple: I’d just copy the code from that example and just replace the core transformation code with yours.

I appreciate the input. I’ve got the call working, now.
I sure wish there was better doc for I6, as used by Inform7.

Here is the final code:

[code]To decide which text is rot13 of (T - text): (- (IT_ROT13({-new:indexed text}, {-by-reference:T})) -).

Include (-
[ IT_ROT13 dest src len i c cp pk;
if (dest==0) return 0;
cp = src–>0;
pk = TEXT_TY_Temporarily_Transmute(src);
TEXT_TY_Transmute(dest);
len = TEXT_TY_CharacterLength(src);
if (BlkValueSetLBCapacity(dest, len+1)) {
for (i=0: i<len: i++) {
c = BlkValueRead(src, i);
switch © {
‘a’ to ‘m’, ‘A’ to ‘M’: c = c + 13;
‘n’ to ‘z’, ‘N’ to ‘Z’: c = c - 13;
}
BlkValueWrite(dest, i, c);
}
BlkValueWrite(dest, len, 0);
}
TEXT_TY_Untransmute(src, pk, cp);
return dest;
]; -).
[/code]