# I6 inclusion leads to blank story pane

Trying some I6 code to call an I7 rule from the I6 code that determines whether to put “a” or “an” before a string (working on [url=https://intfiction.org/t/if-archive-hugo-downloads/59/1]this problem), I tried this:

[code]The Lab is a room.

An animal can be honest or dishonest. Understand the honest property as describing an animal.

Before printing the name of an animal (called beast): say "[if beast is dishonest]dis[end if]honest ".

The unicorn is an animal. It is honest.
The yak is an animal. It is dishonest.

A block is a kind of thing. It has a number called weight. The description of a block is “It looks to be about [weight of the item described in words] pound[s].”
After examining a block (called B):
now the printed name of B is “[weight of B in words] - pound block of [B]”.

The yttrium is a block. The weight is one.

The uniform is wearable. The description is “It’s a United States Army uniform.”
After examining the uniform for the first time:
now the printed name of the uniform is “United States Army uniform”.

A unicorn, a uniform, an hourglass, a yak and yttrium are in the lab.

[create a global variable to be called later in i6:]
[Current vowel sound is a number that varies. Current vowel sound variable translates into i6 as “vowel_sound”.

Before printing the name of a thing (called x):
let T be a text;
now T is the printed name of x;
now Current vowel sound is T evaluated.
[say Current vowel sound.]

To decide what number is (s - a text) evaluated:
if s starts with a vowel sound:
decide on 1;
decide on 0. ]

To decide whether (string - a text) starts with a vowel sound (this is vowel sound checking):
let the first word be punctuated word number 1 in string;
if the first word is a word listed in the Table of Words That Start With Vowel Sounds, yes;
if the first word is a word listed in the Table of Words That Don’t Start With Vowel Sounds, no;
if character number 1 in the first word is a vowel, yes;
no.

To decide whether (letter - a text) is a vowel:
if letter exactly matches the regular expression “a|e|i|o|u|A|E|I|O|U”, yes;
no.

The initial sound rules are a rulebook. The initial sound rules have outcomes vowel and consonant.

An initial sound rule (this is the basic initial sound test rule):
if “[short name storage]” starts with a vowel sound:
vowel;
otherwise:
consonant.

To say the/-- short name storage:
(- PrintShortNameStorage(); -).

Include (-

[ PrintShortNameStorage len i;
len = StorageForShortName–>0;
for ( i = 0 : i < len : i++ )
{
glk_put_char_uni(StorageForShortName–>(i + 1));
}
];

-)
.

word
“hour”
“hourglass”
“honest”
“yttrium”

word
“uniform”
“unicorn”
“united”
“United”
“one”

[end]

Include (-
Global vowel_sound = 0;
-) after “Definitions.i6t”.

Include (-

Constant LanguageAnimateGender = male;
Constant LanguageInanimateGender = neuter;
Constant LanguageContractionForms = 2; ! English has two:
! 0 = starting with a consonant
! 1 = starting with a vowel
[ LanguageContraction text result rv;

!!! This is the old routine:
!if (text->0 == ’a’ or ’e’ or ’i’ or ’o’ or ’u’
!or ’A’ or ’E’ or ’I’ or ’O’ or ’U’) return 1;
!return 0;
!!! Out w/ old – in w/ new:
rv = FollowRulebook( (+ initial sound rules +) );
if ((rv) && RulebookSucceeded()) {
result = ResultOfRule();
if (result == (+ vowel outcome +)) return 1;
return 0;}
return 0;
];
Array LanguageArticles -->
! Contraction form 0: Contraction form 1:
! Cdef Def Indef Cdef Def Indef
"The " "the " "a " "The " "the " "an " ! Articles 0
"The " "the " "some " "The " "the " "some "; ! Articles 1
! a i
! s p s p
! m f n m f n m f n m f n
Array LanguageGNAsToArticles --> 0 0 0 1 1 1 0 0 0 1 1 1;
-) instead of “Articles” in “Language.i6t”.[/code]

Now, I wouldn’t have been surprised if this gave me an I6 compiler failure, because I’m not really sure what I’m doing (what I did was to copy some code from various sources and change it until I stopped getting compiler failures). But what does happen is that Inform claims to have successfully compiled the game and then produces a blank story pane. Does anyone understand why this might happen? I guess if I’ve messed up the I6 at the right moment the game might never get off the ground.

I’m working on a Mac (and you have to compile to Glulx to get it to work at all).

Also, if anyone can give me some more advice about how to get I6 to invoke an I7 phrase that takes a text argument, or an I7 text based rulebook, I’d love to hear it.

Maybe you’re getting into an infinite loop by printing “[short name storage]” while writing to StorageForShortName? (I don’t know, this is just a guess based on a quick look at the code.)