Search found 6594 matches

by dodicat
Sep 22, 2020 13:28
Forum: Tips and Tricks
Topic: Around the Sphere build 2020-09-22
Replies: 14
Views: 411

Re: Around the Sphere build 2020-09-22

Hi UEZ.
Works great here and I use fbide.
by dodicat
Sep 22, 2020 12:56
Forum: Documentation
Topic: Wiki improvements
Replies: 492
Views: 92760

Re: Wiki improvements

There are quite a few definitions of asynchronous callbacks, some say that waiting for a return value makes the callback synchronous. In this case the the C sort callback and my own quicksort callbacks are synchronous. Quote from stack overflow: "In computer programming, a callback is a piece o...
by dodicat
Sep 21, 2020 12:03
Forum: General
Topic: Callback functions in freebasic
Replies: 7
Views: 334

Re: Callback functions in freebasic

Quicksort case independent example. The callbacks are up or down. '========== quicksort setup ============== type direction as function(as string, as string,as long) as long Dim Shared As Ubyte u(255) #define lwr(s) iif(s<91 andalso s>64,s+32,s) For n As Long=0 To 255 u(n)=lwr(n) 'lookup Next Functi...
by dodicat
Sep 20, 2020 14:24
Forum: General
Topic: Sorting Dir() result by date-time attribute
Replies: 18
Views: 297

Re: Sorting Dir() result by date-time attribute

Try this one. #include "crt.bi" #define up <,> #define down >,< #macro SetQsort(datatype,fname,b1,b2,dot) Sub fname(array() As datatype,begin As Long,Finish As Ulong) Dim As Long i=begin,j=finish Dim As datatype x =array(((I+J)\2)) While I <= J While array(I)dot b1 X dot:I+=1:Wend While ar...
by dodicat
Sep 19, 2020 20:04
Forum: General
Topic: Callback functions in freebasic
Replies: 7
Views: 334

Re: Callback functions in freebasic

Nice simple example https://developer.mozilla.org/en-US/docs/Glossary/Callback_function translated function greeting(names as string) as long print "Hello " + names return 0 end function function processUserInput(callback as any ptr) as long dim as string s input "Please enter your na...
by dodicat
Sep 16, 2020 13:32
Forum: General
Topic: Data Compression
Replies: 53
Views: 1226

Re: Data Compression

There are 90 ways to get a pair of numbers from 0 to 9, (P(10,2)=90) You can thus use 90 other ascii chartacters to substitute a pair, thus about 50% compression P(10,3)=720, so there are not enough characters to do that (substitute 3), you could do some of them of course to use up spare characters ...
by dodicat
Sep 16, 2020 10:26
Forum: General
Topic: Object oriented programming or 3d graphics?
Replies: 20
Views: 575

Re: Object oriented programming or 3d graphics?

I had to download glut32.dll to even get started with this new opengl.
But it will be fun experimenting without the old routines.
by dodicat
Sep 16, 2020 10:23
Forum: General
Topic: Data Compression
Replies: 53
Views: 1226

Re: Data Compression

Random digits (0 to 9) are compressible by substitutions. Random ascii characters are not compressible by substitutions, from what source can you find the substitutions?--unicode characters?? Digits: #define Irange(f,l) Int(Rnd*((l+1)-(f)))+(f) Dim Shared As String setkey(0 To 99) Function SAR(s0 As...
by dodicat
Sep 15, 2020 23:09
Forum: General
Topic: Object oriented programming or 3d graphics?
Replies: 20
Views: 575

Re: Object oriented programming or 3d graphics?

OpenGL is a favourite. There are plenty of examples and nothing needs downloaded. Nearly every compiler can use openGL. Examples are all over the internet, it is a universal graphics machine. Example: #Include Once "GL/glu.bi" Dim As Integer xres,yres Screenres 1024,768,32,,2 Screeninfo xr...
by dodicat
Sep 15, 2020 19:18
Forum: General
Topic: A split function implementation code [like VB]
Replies: 11
Views: 274

Re: A split function implementation code [like VB]

I made a simple mid() version, only fb, no external includes. Mid() version versus ptr ptr version for a BIG string. #include "windows.bi" #include "crt.bi" Dim Shared SplitCount As Integer Function SplitChar(sText As ZString Ptr, iChar As Ubyte) As ZString Ptr Ptr Dim iPos As In...
by dodicat
Sep 15, 2020 9:47
Forum: General
Topic: A split function implementation code [like VB]
Replies: 11
Views: 274

Re: A split function implementation code [like VB]

Thanks TT, OK now.
xywhsoft.
Perhaps you should include windows.bi and crt.bi in your code.
Nevertheless, very fast.
by dodicat
Sep 15, 2020 8:52
Forum: General
Topic: A split function implementation code [like VB]
Replies: 11
Views: 274

Re: A split function implementation code [like VB]

The code doesn't run here even If I include crt.bi.
What is RtlMoveMemory for example?
by dodicat
Sep 15, 2020 7:42
Forum: Libraries
Topic: MiniB3d for FreeBasic
Replies: 956
Views: 198056

Re: MiniB3d for FreeBasic

Put the library file (.a or .dll) into the same folder as your code calling it. It will work perfectly well this way. If you really like the library (static .a), then do as Mr Swiss advises. Any .dll you like you can put into your system folder (system32 windows) and put the .dll.a file into the lib...
by dodicat
Sep 13, 2020 14:58
Forum: Beginners
Topic: Initialising an array with many empty elements
Replies: 15
Views: 417

Re: Initialising an array with many empty elements

I don't see much benefit in wrapping an array in a udt (For this case) Type array As String s(1 To 255) As Long idx(1 To 255) Declare const Function find(As Long) As const String Declare Constructor() End Type Constructor array() static as long n if n=1 then print "Closed for business":ret...
by dodicat
Sep 13, 2020 13:25
Forum: Tips and Tricks
Topic: Play videos on the console (Windows)
Replies: 5
Views: 214

Re: Play videos on the console (Windows)

Thanks for testing Grindstone. My Win 10 is brand new, I have no video codecs installed, If I see an icon with a snapshot of the video clip on a film strip frame mcisendstring usually plays it, and clicking that file plays it (Films & TV) The blue icon with a triangle doesn't play. .mp3 and .wav...

Go to advanced search