Inform - Support - Source

Back to List

Inventory
Complete

Backward
Forward

Plain
Coloured
Gaudy

This code
in plain text

Browsing parserm.h

PrintToBuffer (lines 6086-6117)

6086  #IfV5;
6087   
6088  #Ifdef VN_1630;
6089  Array StorageForShortName buffer 160;
6090  #Ifnot;
6091  Array StorageForShortName -> 160 + WORDSIZE;
6092  #Endif; ! VN_1630
6093   
6094  #Endif; ! V5
6095   
6096  #Ifdef TARGET_ZCODE;
6097   
6098  ! Platform-independent way of printing strings and properties to a
6099  ! buffer (defined as length word followed by byte characters).
6100   
6101  [ PrintToBuffer buf len a b c;
6102      @output_stream 3 buf;
6103      switch (metaclass(a)) {
6104        String:
6105          print (string) a;
6106        Routine:
6107          a(b, c);
6108        Object,Class:
6109          if (b)
6110              PrintOrRun(a, b, true);
6111          else
6112              print (name) a;
6113      }
6114      @output_stream -3;
6115      if (buf-->0 > len) print "Error: Overflow in PrintToBuffer.^";
6116      return buf-->0;
6117  ];


Last updated 27 February 2004. This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation. Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson assisted by C Knight.