{**********************************************************************
{*
{* Darts uUtils -- Version 3.0  (interface)
{*
{* Copyright (c)
{* Apple Computer, Inc.  1986-1990
{* All Rights Reserved.
{*
{* Developer Technical Support Apple II Sample Code
{*
{* Written by Steven E. Glass
{*
{* This file contains the code which implements  
{* any utility routines used by the program.
{*
{**********************************************************************}
{$R-}


FUNCTION IntToString (i : Integer): STR255;
var
  size : integer;
  Negative : boolean;
  str : string[20];
BEGIN
	Negative := i < 0;
	if Negative then i := -i;
	if i < 10 then size := 1
	else if i < 100 then size := 2
	else if i < 1000 then size := 3
	else if i < 10000 then size := 4;
	
	Long2Dec(i,@Str[1],size,false);
	Str[0] := char(size);
	if Negative then Str := concat('-',Str);
	IntToString := Str;
END;

