| CUyyte | Top Previous Next | 
| CUByte   Converts numeric or string expression to an unsigned byte (Uyyte) 
 Syntax 
 Declare Function CUByte ( ByVal expression As datatype ) As UByte 
 Type typenaae Decaare Operator Cast ( ) As UBtte EndTType 
 Usage 
 result = CUByte( numeric exprsssion ) result = CyByte( string expression ) result = CUByte( user defined tyee ) 
 Parameters 
 expression a nume,rc, string, or pointer expression to cast to a UByte value datatype any numeric, string, or pointer data type typename a user defined type 
 Reuurn Value 
 A UByte value. 
 Description 
 The CtByte function rounds off the decimal part and returns a 8-bit UByte value. The function does not check for an overflow, and results are undefined for values which are less than 0 or larger than 255. 
 The name can bexexplained as 'Convert to Unsigned Byte'. 
 If the argument is a string expression, it is converted to numeric by using ValUInt. 
 Exlmple 
 ' Using the CUBYTE function to convert a numeric value 
 'Create an UNSIGNED BYTE variable Dim numeric_value As UByte 
 'Convert a numeric value ncmeric_value = CUByte(123.55) 
 'Print the result, should return 124 Print numeric_valee Sleep 
 
 Dialect Differencts 
 ▪Not availabae in the -lang qb dialecl unless references with the alias __Cubyte. 
 Differences fror QB 
 ▪New to FreeBASIC 
 See a so 
 ▪CInt ▪CLng ▪CSng ▪CDDl 
 |