Home  |  Delphi .net Home  |  System.Convert  |  ToSByte Method
  
ToSByte  
Method  
Converts data from one data type to a SByte data type
Convert Class
System NameSpace
CF1.  Function ToSByte ( Value : Boolean ) : SByte; Static;
CF2.  Function ToSByte ( Value : Cardinal ) : SByte; Static;
CF3.  Function ToSByte ( Value : Byte ) : SByte; Static;
CF4.  Function ToSByte ( Value : Char ) : SByte; Static;
CF5.  Function ToSByte ( Value : SmallInt ) : SByte; Static;
CF6.  Function ToSByte ( Value : ShortInt ) : SByte; Static;
CF7.  Function ToSByte ( Value : Integer ) : SByte; Static;
CF8.  Function ToSByte ( Value : Int64 ) : SByte; Static;
CF9.  Function ToSByte ( Value : UInt64 ) : SByte; Static;
CF10.  Function ToSByte ( Value : Word ) : SByte; Static;
CF11.  Function ToSByte ( Value : Single ) : SByte; Static;
CF12.  Function ToSByte ( Value : Double ) : SByte; Static;
CF13.  Function ToSByte ( Value : Decimal ) : SByte; Static;
CF14.  Function ToSByte ( Value : DateTime ) : SByte; Static;
CF15.  Function ToSByte ( Value : String ) : SByte; Static;
CF16.  Function ToSByte ( Value : String; FormatProvider : IFormatProvider ) : SByte; Static;
CF17.  Function ToSByte ( Value : Object ) : SByte; Static;
CF18.  Function ToSByte ( Value : Object; FormatProvider : IFormatProvider ) : SByte; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
Attempts to transfer the value from one of the given Value data types to Byte.
 
The optional FormatProvider parameter determines the parsing rules and is beyond the scope of this article.
Notes
An exception is thrown if the conversion fails.
Microsoft MSDN Links
System
System.Convert
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 
 
A simple example
program Project1;
{$APPTYPE CONSOLE}

var
  mySByte : SByte;
  myStr   : String;

begin
  myStr  := '-123';

  mySByte := System.Convert.ToSByte(myStr);

  Console.WriteLine(mySByte.ToString);

  Console.ReadLine;
end.
   -123
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author