Sage-ST ä

Convert

Documentation

Global Declarations (Constants, Types, Variables)
CardToPercent CardToStr IntToStr
LongIntToStr NumToStr NumberToRoman RomanToNumber
STRCardToPercent STRCardToStr STRIntToStr STRLongIntToStr
STRNumToStr STRNumberToRoman STRRomanToNumber STRStrToCard
STRStrToInt STRStrToLongInt STRStrToNum StrToCard
StrToInt StrToLongInt StrToNum





  const
    MaxBase = 16;

  type
    BaseType = 2 .. MaxBase;




  procedure IntToStr
             (const int     : integer;
              var   Str     : array of char;
              const width   : cardinal;
              var   Success : boolean); overload; stdcall;

  exports IntToStr (const int     : integer;
                    var   Str     : array of char;
                    const width   : cardinal;
                    var   Success : boolean) name 'Convert_IntToStr';

  //*
  //  IntToStr - Convert Integer to string, can be a fixed size.
  //
  //  This procedure converts an Integer into a string that represents the
  //  number.  There are two modes of using this routine.  If the value of
  //  width is equal to 0 then the value is converted to string in a free
  //  format.  If the value of width is greater than 0 the string is converted
  //  in a fixed format.
  //
  //  Free format - If the value of width is 0 then this format is used.  This
  //  results in a string that is always left justified and only shows the sign
  //  position if the number is negative.  In this mode the only constraint to
  //  converting is the size of the string that was passed in.
  //
  //  Fixed format - If the value of width is greater than 0 then this format is
  //  used.  In this mode the value is converted to a total length that equals
  //  the size of width.  NOTE - The value of width INCLUDES the sign character
  //  if the number is negative (i.e. the value of -100 requires a width of 4).
  //  If the value is positive it can completely fill the string (i.e. a width
  //  of 4 can handle a positive value up to 9999).
  //
  //  If the string passed is shorter than width or if the converted value will
  //  not fit within the length of the string then SageError #16
  //  (SageErrs.ArrayTooSmall) is generated.
  //




  procedure IntToStr
             (const int     : integer;
              var   Str     : string;
              const width   : cardinal;
              var   Success : boolean); overload; stdcall;

  exports IntToStr (const int     : integer;
                    var   Str     : string;
                    const width   : cardinal;
                    var   Success : boolean) name 'Convert_STRIntToStr';

  //*
  //  STRIntToStr - See documentation of IntToStr.
  //




  procedure LongIntToStr
             (const int     : ModSys.INT32;
              var   Str     : array of char;
              const width   : cardinal;
              var   Success : boolean); overload; stdcall;

  exports LongIntToStr (const int     : ModSys.INT32;
                        var   Str     : array of char;
                        const width   : cardinal;
                        var   Success : boolean) name 'Convert_LongIntToStr';

  //*
  //  LongIntToStr - Convert Integer to string, can be a fixed size.
  //
  //  This procedure converts a Long Integer into a string that represents the
  //  number.  There are two modes of using this routine.  If the value of
  //  width is equal to 0 then the value is converted to string in a free
  //  format.  If the value of width is greater than 0 the string is converted
  //  in a fixed format.
  //
  //  Free format - If the value of width is 0 then this format is used.  This
  //  results in a string that is always left justified and only shows the sign
  //  position if the number is negative.  In this mode the only constraint to
  //  converting is the size of the string that was passed in.
  //
  //  Fixed format - If the value of width is greater than 0 then this format is
  //  used.  In this mode the value is converted to a total length that equals
  //  the size of width.  NOTE - The value of width INCLUDES the sign character
  //  if the number is negative (i.e. the value of -100 requires a width of 4).
  //  If the value is positive it can completely fill the string (i.e. a width
  //  of 4 can handle a positive value up to 9999).
  //
  //  If the string passed is shorter than width or if the converted value will
  //  not fit within the length of the string then SageError #16
  //  (SageErrs.ArrayTooSmall) is generated.
  //




  procedure LongIntToStr
             (const int     : ModSys.INT32;
              var   Str     : string;
              const width   : cardinal;
              var   Success : boolean); overload; stdcall;

  exports LongIntToStr (const int     : ModSys.INT32;
                        var   Str     : string;
                        const width   : cardinal;
                        var   Success : boolean) name 'Convert_STRLongIntToStr';

  //*
  //  STRLongIntToStr - See documentation of LongIntToStr.
  //




  procedure CardToStr
             (const card    : cardinal;
              var   Str     : array of char;
              const width   : cardinal;
              var   Success : boolean); overload; stdcall;

  exports CardToStr (const card    : cardinal;
                     var   Str     : array of char;
                     const width   : cardinal;
                     var   Success : boolean) name 'Convert_CardToStr';

  //*
  //  CardToStr - Convert cardinal to string, can be a fixed size.
  //
  //  This procedure converts a cardinal into a string that represents the
  //  number.  There are two modes of using this routine.  If the value of
  //  width is equal to 0 then the value is converted to string in a free
  //  format.  If the value of width is greater than 0 the string is converted
  //  in a fixed format.
  //
  //  Free format - If the value of width is 0 then this format is used.  This
  //  results in a string that is always left justified.  In this mode the only
  //  constraint to converting is the size of the string that was passed in.
  //
  //  Fixed format - If the value of width is greater than 0 then this format is
  //  used.  In this mode the value is converted to a total length that equals
  //  the size of width (i.e. a width of 4 can handle a value up to 9999).
  //
  //  If the string passed is shorter than width or if the converted value will
  //  not fit within the length of the string then SageError #16
  //  (SageErrs.ArrayTooSmall) is generated.
  //




  procedure CardToStr
             (const card    : cardinal;
              var   Str     : string;
              const width   : cardinal;
              var   Success : boolean); overload; stdcall;

  exports CardToStr (const card    : cardinal;
                     var   Str     : string;
                     const width   : cardinal;
                     var   Success : boolean) name 'Convert_STRCardToStr';

  //*
  //  STRCardToStr - See documentation of CardToStr.
  //




  procedure NumToStr
             (const Num     : cardinal;
              var   Str     : array of char;
              const base    : cardinal;    // [2 .. 36]
              const width   : cardinal;
              var   Success : boolean); overload; stdcall;

  exports NumToStr (const Num     : cardinal;
                    var   Str     : array of char;
                    const base    : cardinal;
                    const width   : cardinal;
                    var   Success : boolean) name 'Convert_NumToStr';

  //*
  //  NumToStr - Convert cardinal to string, can be a fixed size.
  //
  //  This procedure converts a cardinal into a string that represents the
  //  number in the requested base.  There are two modes of using this routine.
  //  If the value of width is equal to 0 then the value is converted to string
  //  in a free format.  If the value of width is greater than 0 the string is
  //  converted in a fixed format.
  //
  //  Free format - If the value of width is 0 then this format is used.  This
  //  results in a string that is always left justified.  In this mode the only
  //  constraint to converting is the size of the string that was passed in.
  //
  //  Fixed format - If the value of width is greater than 0 then this format is
  //  used.  In this mode the value is converted to a total length that equals
  //  the size of width (i.e. a width of 4 can handle a value up to 9999).
  //
  //  If the string passed is shorter than width or if the converted value will
  //  not fit within the length of the string then SageError #16
  //  (SageErrs.ArrayTooSmall) is generated.
  //




  procedure NumToStr
             (const Num     : cardinal;
              var   Str     : string;
              const base    : cardinal;    // [2 .. 36]
              const width   : cardinal;
              var   Success : boolean); overload; stdcall;

  exports NumToStr (const Num     : cardinal;
                    var   Str     : string;
                    const base    : cardinal;
                    const width   : cardinal;
                    var   Success : boolean) name 'Convert_STRNumToStr';

  //*
  //  STRNumToStr - See documentation of NumToStr.
  //




  procedure StrToInt
             (const Str     : array of char;
              var   int     : integer;
              var   Success : boolean); overload; stdcall;

  exports StrToInt (const Str     : array of char;
                    var   int     : integer;
                    var   Success : boolean) name 'Convert_StrToInt';




  procedure StrToInt
             (const Str     : string;
              var   int     : integer;
              var   Success : boolean); overload; stdcall;

  exports StrToInt (const Str     : string;
                    var   int     : integer;
                    var   Success : boolean) name 'Convert_STRStrToInt';




  procedure StrToLongInt
             (const Str     : array of char;
              var   int     : ModSys.INT32;
              var   Success : boolean); overload; stdcall;

  exports StrToLongInt (const Str     : array of char;
                        var   int     : ModSys.INT32;
                        var   Success : boolean) name 'Convert_StrToLongInt';




  procedure StrToLongInt
             (const Str     : string;
              var   int     : ModSys.INT32;
              var   Success : boolean); overload; stdcall;

  exports StrToLongInt (const Str     : string;
                        var   int     : ModSys.INT32;
                        var   Success : boolean) name 'Convert_STRStrToLongInt';




  procedure StrToCard
             (const Str     : array of char;
              var   card    : cardinal;
              var   Success : boolean); overload; stdcall;

  exports StrToCard (const Str     : array of char;
                     var   card    : cardinal;
                     var   Success : boolean) name 'Convert_StrToCard';




  procedure StrToCard
             (const Str     : string;
              var   card    : cardinal;
              var   Success : boolean); overload; stdcall;

  exports StrToCard (const Str     : string;
                     var   card    : cardinal;
                     var   Success : boolean) name 'Convert_STRStrToCard';




  procedure StrToNum
             (const Str     : array of char;
              var   Num     : cardinal;
              const base    : cardinal;    // [2 .. 36]
              var   Success : boolean); overload; stdcall;

  exports StrToNum (const Str     : array of char;
                    var   Num     : cardinal;
                    const base    : cardinal;    // [2 .. 36]
                    var   Success : boolean) name 'Convert_StrToNum';




  procedure StrToNum
             (const Str     : string;
              var   Num     : cardinal;
              const base    : cardinal;    // [2 .. 36]
              var   Success : boolean); overload; stdcall;

  exports StrToNum (const Str     : string;
                    var   Num     : cardinal;
                    const base    : cardinal;    // [2 .. 36]
                    var   Success : boolean) name 'Convert_STRStrToNum';




  procedure NumberToRoman
             (const Number   : cardinal;
              var   RomanStr : array of char;
              var   Success  : boolean); overload; stdcall;

  exports NumberToRoman (const Number   : cardinal;
                         var   RomanStr : array of char;
                         var   Success  : boolean) name 'Convert_NumberToRoman';




  procedure NumberToRoman
             (const Number   : cardinal;
              var   RomanStr : string;
              var   Success  : boolean); overload; stdcall;

  exports NumberToRoman (const Number   : cardinal;
                         var   RomanStr : string;
                         var   Success  : boolean) name 'Convert_STRNumberToRoman';




  procedure RomanToNumber
             (const RomanStr : array of char;
              var   Number   : cardinal;
              var   Success  : boolean); overload; stdcall;

  exports RomanToNumber (const RomanStr : array of char;
                         var   Number   : cardinal;
                         var   Success  : boolean) name 'Convert_RomanToNumber';




  procedure RomanToNumber
             (const RomanStr : string;
              var   Number   : cardinal;
              var   Success  : boolean); overload; stdcall;

  exports RomanToNumber (const RomanStr : string;
                         var   Number   : cardinal;
                         var   Success  : boolean) name 'Convert_STRRomanToNumber';




  procedure CardToPercent
             (const CardValue   : cardinal;
              const TotalValue  : cardinal;
              var   CardPercent : cardinal;
              var   StrPercent  : array of char); overload; stdcall;

  exports CardToPercent (const CardValue   : cardinal;
                         const TotalValue  : cardinal;
                         var   CardPercent : cardinal;
                         var   StrPercent  : array of char) name 'Convert_CardToPercent';

  //*
  //  CardToPercent - Calculate and return the percent that a number is.
  //




  procedure CardToPercent
             (const CardValue   : cardinal;
              const TotalValue  : cardinal;
              var   CardPercent : cardinal;
              var   StrPercent  : string); overload; stdcall;

  exports CardToPercent (const CardValue   : cardinal;
                         const TotalValue  : cardinal;
                         var   CardPercent : cardinal;
                         var   StrPercent  : string) name 'Convert_STRCardToPercent';

  //*
  //  STRCardToPercent - See documentation of CardToPercent.
  //




Send mail to   warren.merrill@inl.gov with questions or comments about this web site.
Copyright © 1989-2006 Battelle Energy Alliance