Search found 66 matches
- Mar 04, 2025 21:07
- Forum: General
- Topic: Idea or challenge ?!
- Replies: 25
- Views: 3134
Re: Idea or challenge ?!
Thanks Jattenalle. Say just look for A, then taking a gunk of memory and redim preserve when necessary is faster than redim preserve each time. But I agree, instr is plenty fast for most things. Since mine preserves the array you can set the size before passing it. So replacing the redim as long g(...
- Mar 04, 2025 14:00
- Forum: General
- Topic: Idea or challenge ?!
- Replies: 25
- Views: 3134
Re: Idea or challenge ?!
I made a Tally sub a while back. i.e. get the positions of all substrings in a string. #cmdline "-gen gcc -Wc -O2" Function tally (somestring As String,partstring As String,arr() As Long) As Ulong Redim arr(1 To 1000) Dim As Long i,j,ln,lnp,count ln=Len(somestring) lnp=Len(partstring) cou...
- Jan 05, 2025 14:09
- Forum: General
- Topic: Detecting Math Errors
- Replies: 6
- Views: 1814
Re: Detecting Math Errors
It's checking for the specific bitmasks that corresponds to IEEE float definitions for invalid floats. So, would I need to change that for a DOUBLE implementation? If so, how? Sorry, I didn't know there'd be different answers for every different data type. I did use the basic comparison to 1/0 and ...
- Jan 05, 2025 13:05
- Forum: General
- Topic: Detecting Math Errors
- Replies: 6
- Views: 1814
Re: Detecting Math Errors
Thank you. Is it possible to describe what this is accomplishing: ((*raw And &H7F800000) = &H7F800000) And (*raw And &H007FFFFF) <> 0 I mean, I get that it's doing something with bit masks. I think. It's checking for the specific bitmasks that corresponds to IEEE float definitions for i...
- Jan 04, 2025 15:10
- Forum: General
- Topic: Detecting Math Errors
- Replies: 6
- Views: 1814
Re: Detecting Math Errors
Overflow UINTEGER addition implementation: Function addOverflowInteger(ByVal lhs As uinteger, ByVal rhs As uinteger, byref result as uinteger) As boolean function = TRUE result = lhs + rhs Asm jc overflow mov [Function], FALSE overflow: End Asm End Function dim as uinteger result dim as uinteger l, ...
- Nov 05, 2024 14:59
- Forum: Beginners
- Topic: Mdi example help
- Replies: 27
- Views: 8192
Re: Mdi example help
RGBA component handling is a perfect opportunity for a struct, union, and constructor: type _rgba union c as ulong type b as ubyte '// FB color byte order is BGRA g as ubyte r as ubyte a as ubyte end type end union declare constructor declare constructor(as ulong) end type constructor _rgba() end co...
- Oct 30, 2024 14:57
- Forum: Projects
- Topic: VFB IDE【Visual Freebasic】5.9.3(vb7,vb6)2024-11-1
- Replies: 157
- Views: 106731
Re: VFB IDE【Visual Freebasic】5.9.1(vb7,vb6)2024-2-12
The VisualFreeBasic5.9.2.b.7z download is throwing all kinds of red-flags. There's a lot of weird, unusual, things going on with the files in the 7z's. Not the least of which are: Downloading and executing code from a file cdn Dropping files into the system folders Modifying/injecting executable co...
- Oct 22, 2024 5:14
- Forum: Windows
- Topic: Fast copy of all the bytes in a ubyte ptr to a string ??
- Replies: 22
- Views: 9642
Re: Fast copy of all the bytes in a ubyte ptr to a string ??
I have a bit of a bottleneck in my code the windows "COM" API passes me a pointer to an array of ubyte and a size but I need to convert this into a string. At the moment I have a simple while loop concatenating individual bytes into the string --- NOT ideal. While browsing yesterday I saw...
- Oct 19, 2024 5:27
- Forum: DOS
- Topic: Programs with external static libraries
- Replies: 2
- Views: 4316
Re: Programs with external static libraries
What you're describing is a .dxe, you can create them with the -dylib or -dll commandline option when compiling your library.
More information regarding shared libraries in DOS can be found here in the documentation
More information regarding shared libraries in DOS can be found here in the documentation
- Oct 17, 2024 16:26
- Forum: General
- Topic: [FBC BUG] 32bit allocate overflow
- Replies: 8
- Views: 5148
Re: [FBC BUG] 32bit allocate overflow
Except we have precedence for adding a compiler check for type overflows where it can cause issues:
Code: Select all
for i as ubyte = 0 to 255
next
- Oct 17, 2024 7:05
- Forum: General
- Topic: [FBC BUG] 32bit allocate overflow
- Replies: 8
- Views: 5148
[FBC BUG] 32bit allocate overflow
Issue: The allocate family takes a uinteger as its param causing overflow and misleading results if passed larger types/values than uinteger Affects: -arch 32bit, both GAS and GCC Description: Passing a value larger than MAX_UINTEGER causes an overflow, which can cause code that should fail to succ...
- Oct 17, 2024 6:43
- Forum: General
- Topic: Anyone using 16GB arrays and passing them around between functions?
- Replies: 15
- Views: 6463
Re: Anyone using 16GB arrays and passing them around between functions?
Small code to display the maximum memory block size that can be dynamically allocated: [...] - With fbc 64-bit: Maximum memory block size that can be dynamically allocated: 18.91 GB OK - With fbc 32-bit: Maximum memory block size that can be dynamically allocated: 1.78 GB OK Some improvements/fixes...
- Oct 14, 2024 1:21
- Forum: Libraries & Headers
- Topic: OpenGL Math library libglmc
- Replies: 5
- Views: 8575
Re: OpenGL Math library libglmc
I created the header file for OpenGL Mathematics for C cglm where it is? hum... i assume you added the garbage OOP to the header in a futile attempt to have aligned datatypes... but without shoving a HUGE WARNING about that anyway yeah it's past time for freebasic to properly fix their "field&...
- Oct 13, 2024 7:42
- Forum: General
- Topic: Any compiler switch available to scream "variable or function not declared!!!"?
- Replies: 5
- Views: 3592
Re: Any compiler switch available to scream "variable or function not declared!!!"?
Assuming you're still using the old -lang qb or -lang fblite, you can use OPTION EXPLICIT
In the modern, default -lang, FBC will always tell you about any missing definitions.
In the modern, default -lang, FBC will always tell you about any missing definitions.
- Oct 13, 2024 6:49
- Forum: General
- Topic: Workarounds for preprocessor oddities?
- Replies: 4
- Views: 6123
Re: Workarounds for preprocessor oddities?
Welcome to the club of "People who would like to use typeof() for cool pre-parsing shenanigans but can't"! The short of it is that typeof() is in-between both a runtime and pre-processing operator, while also being neither. As you've noticed typeof() is not (Except sometimes) evaluated bef...