



LTI_Insert (lines 4336-4361)
Back to List
Browsing parserm.h
4336 #Endif; ! TARGET_
4337
4338 ! ----------------------------------------------------------------------------
4339 ! Provided for use by language definition files
4340 ! ----------------------------------------------------------------------------
4341
4342 #Ifdef TARGET_ZCODE;
4343
4344 [ LTI_Insert i ch b y;
4345
4346 ! Protect us from strict mode, as this isn't an array in quite the
4347 ! sense it expects
4348 b = buffer;
4349
4350 ! Insert character ch into buffer at point i.
4351 ! Being careful not to let the buffer possibly overflow:
4352 y = b->1;
4353 if (y > b->0) y = b->0;
4354
4355 ! Move the subsequent text along one character:
4356 for (y=y+2 : y>i : y--) b->y = b->(y-1);
4357 b->i = ch;
4358
4359 ! And the text is now one character longer:
4360 if (b->1 < b->0) (b->1)++;
4361 ];
Last updated 27 February 2004. The librarian in charge of this page is Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight. Please email any comments, suggestions or corrections to cedenqs@inform-fiction.org.