Recent posts

#1
OxygenBasic Examples / Re: CByte
Last post by Frank Brübach - Yesterday at 08:03:31 PM
Oh good didn't know yet thx Charles

Found an old freebasic examples with cByte(260)=4 and I didnt understand the result but now... ;)


''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
#2
OxygenBasic Examples / Re: CByte
Last post by Charles Pegge - Yesterday at 06:01:03 PM
Hi Frank,

string-to-number conversion etc is built into Oxygen:

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
#3
OxygenBasic Examples / CByte
Last post by Frank Brübach - Yesterday at 01:19:19 PM
Hello Charles, do you know cByte?
Its interesting datatype for oxygen too? Its existing in freebasic as converting Data Type

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
#4
News and Announcements / 🚀 New update from 27.05.2024
Last post by Theo Gottwald - Yesterday at 08:06:16 AM
[English]
📢🤖🆕 Yesterday, I released a new update for the smart package robot! 🚀 This update includes important changes for parallel running robots. 💡 Check out the sample code to see how to use parallel running robots as a watchdog to prevent a main program from hanging. 🕵��♀️ And don't forget to try out the newest version of the social media assistant button bar that is in the Sample Scripts Folder!

📲 #smartpackagerobot #update #parallelrunning #watchdog #socialmediaassistant #code #innovation 💡🤖🚀🕵��♀️📲

[German]
Gestern habe ich ein neues Update für den smarten Paketroboter veröffentlicht! 🤖✨ Dieses Update beinhaltet wichtige Änderungen für parallel laufende Roboter. 🚀💡 Schaut euch den Beispielcode an, um zu sehen, wie ihr parallel laufende Roboter als Wachhund nutzen könnt, um ein Hauptprogramm vor dem Einfrieren zu bewahren. 🛡�🖥� Vergesst nicht, die neueste Version der Social Media Assistant Button-Leiste auszuprobieren! 🌐🔍

#smartpackagerobot #update #parallelrunning #watchdog #socialmediaassistant #code #innovation 🤖💻📦
#5
I agree that the current way cows are treated in the Meat industry is a big problem and should be changed.
Less money for military and more money for food production in a way that animal are treated as good as possible.
Why do we need extraterrestrials to find that out?
If you just sit down and think a moment you will also recognize what wrong.
Maybe you will not find out who is behind, but you see the signs.
#6
Extraterrestrial Meetings: Five True Cases

Preston Dennett
10 Feb 2024


-->

Conversations with Extraterrestrials

Preston Dennett
5 apr 2021

#7
OxygenBasic Examples / Re: Oxygen 32 or 64 Bit?
Last post by Charles Pegge - May 27, 2024, 12:45:47 PM
Hi Frank,

mode32bit and mode64bit:
these are set from rtl32.inc and rtl64.inc respectively

#ifdef mode64bit
...
#else
...
#endif

The MessageBox example looks correct for 64bit calling
#8
OxygenBasic Examples / Re: Oxygen 32 or 64 Bit?
Last post by Frank Brübach - May 27, 2024, 12:32:59 PM
Hey Charles

Can you Tell me If this is a valuable 64 Bit Code example? If Not have you another oxygen example?

$ 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


#9
OxygenBasic Examples / Oxygen 32 or 64 Bit?
Last post by Frank Brübach - May 27, 2024, 12:16:57 PM
Good morning,

Have a question how I can detect If its compiled in 32 or 64 Bit?

'' 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"

#10
OxygenBasic / Re: Hide exec process
Last post by Nicola - May 27, 2024, 01:00:59 AM
Hi Charles,
That sounds like a great idea to me. In this way we can use the various possibilities available.
Thank you.