''CodeSelect
sbyte sb 'signed byte
sb=32
print sb
sb=32.6
print sb 'rounds to 33
sb="-32"
print sb 'auto-convert string -32
sb=255
print sb 'wrap overflow -1
' if that's -1 then 260 it's 4 ?
' why it's 4 as result? => 5 - 1 ? = 4
sb=260
print sb ' 4
CBYTE
Converts numeric or string expression to Byte.
Syntax:
declare function Cbyte ( byval expression as datatype ) as byte
Type typename
declare operator cast ( ) as byte
End Type
Usage:
result = Cbyte( numeric expression )
result = Cbyte( string expression )
result = Cbyte( user defined type )
Parameters:
expression
A numeric, string, or pointer expression to cast to a Byte value.
datatype
Any numeric, string, or pointer data type.
typename
A user defined type.
Return Value:
A Byte value.
Description:
The Cbyte function rounds off the decimal part and returns a 8-bit Byte value. The function does not check for an overflow, and results are undefined for values which are less than -128 or larger than 127.
The name can be explained as 'Convert to Byte'.
If the argument is a string expression, it is converted to numeric by using Valint.
Examples:
' Using the CBYTE function to convert a numeric value
'Create an BYTE variable
Dim numeric_value As Byte
'Convert a numeric value
numeric_value = CByte(-66.30)
'Print the result, should return -66
Print numeric_value
Sleep
$ FileName "test64abcd.exe"
#include "$\inc\RTL64.inc"
Declare Function MessageBox Lib "user32.dll" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Sys
byte val1
byte val2
int result ''resd 1
val1=4
val2=6 '
mov eax,val1
mov eax,val2 ''multiply eax by ebx "
mul val1 'ebx
mov result,eax
zstring tit[]="64Bit OxygenBasic"
zstring msg[]="Hello dear Animal World! " + str(result)
'' oxygen 64 bit
''
sub rsp,40h ''32
mov r9, 0
lea r8, tit
lea rdx, msg
mov rcx, 0
call messagebox
add rsp, 40h ''32
'' oxygen 64 bit
''
'' output: Hello dear Animal World! 24
'' how I can detect if it's 32 bit or 64 bit
'' oxygen basic
''
#if defined( __FB_64BIT__ ) '' ?? ( __OXYGEN_64BIT__ )
#print "Producing 64-bit code output"
#else
#print "Producing 32-bit code output"
#endif
print "ok"
Page created in 0.169 seconds with 11 queries.