Search found 6196 matches

by dodicat
Apr 01, 2020 18:35
Forum: Beginners
Topic: (SOLVED) The extra destructor is called
Replies: 13
Views: 233

Re: The extra destructor is called

Hi. Type rational numerator As Integer denominator As Integer Declare Function A(x As Double) As Double Declare Function F(x As Double) As Double Declare Constructor() Declare Destructor() End Type Constructor rational() For n As Long=1 To 6 Print Chr(A(n)); Next End Constructor Destructor rational(...
by dodicat
Mar 31, 2020 15:00
Forum: Community Discussion
Topic: Freebasic is not smooth in graphics
Replies: 17
Views: 636

Re: Freebasic is not smooth in graphics

Hi Basiccoder2.
I've got rid of the end if's
I must have forgot to indent before I posted.
See the projects section for cubes instead of pendulums.
by dodicat
Mar 31, 2020 14:58
Forum: Tips and Tricks
Topic: fbgfx versus opengl graphics
Replies: 6
Views: 233

fbgfx versus opengl graphics

Windows Using cubes and painting openGL to an FB screen. Which one is FBGFX and which one is OpenGL? #include "windows.bi" #include "GL\glu.bi" Sub glinit(xres As Long,yres As Long) glViewport 0, 0, xres, yres '' Reset The Current Viewport glMatrixMode GL_PROJECTION '' Select The...
by dodicat
Mar 31, 2020 8:47
Forum: Community Discussion
Topic: Freebasic is not smooth in graphics
Replies: 17
Views: 636

Re: Freebasic is not smooth in graphics

Hi basiccoder2.
Thanks for testing.
The indentations are an fbide option, tab size set at 4.
by dodicat
Mar 29, 2020 20:25
Forum: Projects
Topic: Charger - A General FreeBASIC Framework
Replies: 11
Views: 382

Re: Charger - A General FreeBASIC Framework

I haven't done much work with FreeBASIC frames. I only got five done. Type frame Private: As Any Ptr i As Long x,y As Long w,h Declare Sub show() Declare Function map(a As Single,b As Single,x As Single,c As Single,d As Single) As Single Declare Function overlapped(() As frame) As Long Public: Decla...
by dodicat
Mar 28, 2020 19:02
Forum: Community Discussion
Topic: Multiplatform coroutines in C and also in FreeBasic
Replies: 6
Views: 288

Re: Multiplatform coroutines in C and also in FreeBasic

You can get a minGW from the NEWS section (the latest fb compilers).
Just unpack it and set the bin folder on the system path.
You have gcc and g++ (C++) compilers, Fortran, gendef (for dll work), nm to look into libraries and many other handy things.
by dodicat
Mar 28, 2020 15:57
Forum: Community Discussion
Topic: Multiplatform coroutines in C and also in FreeBasic
Replies: 6
Views: 288

Re: Multiplatform coroutines in C and also in FreeBasic

I tested this angros47 this is main this is the thread, iteration 1 this is main this is the thread, iteration 2 this is main this is the thread, iteration 3 this is main this is the thread, iteration 4 this is main this is the thread, iteration 5 . . . . . . Since I have 32 bit minGW on path I just...
by dodicat
Mar 28, 2020 13:54
Forum: Community Discussion
Topic: Freebasic is not smooth in graphics
Replies: 17
Views: 636

Re: Freebasic is not smooth in graphics

Here is an openGL pendulum and a gfx pendulum together. #include "windows.bi" #include "GL\glu.bi" Dim Shared As Integer refresh_rate Dim Shared As Integer w,h Sub glcircle(x As Single,y As Single,rx As Single,ry As Single,clr As Ulong) Export Const pi2 = 8*Atn(1),st=pi2/(60) gle...
by dodicat
Mar 28, 2020 10:17
Forum: General
Topic: Corona virus simulator
Replies: 40
Views: 1242

Re: Corona virus simulator

I had implemented a line segment distance via cross products and all the vector operators +,-,*(a scaler), e.t.c. it worked OK also it worked for 3D. But I replaced it with a much faster 2D version using only school co-ordinate geometry. Also the fbgfx filled circle is not very good for small circle...
by dodicat
Mar 25, 2020 23:43
Forum: General
Topic: Corona virus simulator
Replies: 40
Views: 1242

Re: Corona virus simulator

Not so much a simulation but a message. Redim As Long t() Dim As Long x Do x+=1 Redim Preserve t(1 To x) Read t(x) Loop Until t(x)=-1 Redim Preserve t(1 To Ubound(t)-1) Type pt As Long x,y As Ulong col As Long idx,done #define range(f,l) Int(Rnd*((l+1)-(f)))+(f) End Type Function dist(p1 As pt,p2 As...
by dodicat
Mar 25, 2020 11:55
Forum: General
Topic: Parse string to tree structure (solved)
Replies: 55
Views: 1490

Re: Parse string to tree structure (solved)

Hi Lost Zerling. I always enjoy reading your colourful written English. I appreciate that your own project is general and can be adapted for this thread. I do test out code on SARG's GAS64, but my knowledge of assembler is not good enough to make sensible contributions. But GAS64 it is a brilliant p...
by dodicat
Mar 25, 2020 0:47
Forum: General
Topic: Parse string to tree structure (solved)
Replies: 55
Views: 1490

Re: Parse string to tree structure (solved)

UEZ and all. Let the OS take the strain, saves fluffing around with home made trees. That's me done here also, here is a checker version for LINUX. #include "file.bi" Sub string_split(byval s As String,chars As String,result() As String) redim result(0) Dim As String var1,var2 Dim As long ...
by dodicat
Mar 24, 2020 16:04
Forum: General
Topic: Parse string to tree structure (solved)
Replies: 55
Views: 1490

Re: Parse string to tree structure (solved)

Hello UEZ. I think yours is good. Here is my check (windows) Save and run in a dedicated folder It the literal thing. #include "file.bi" Sub string_split(byval s As String,chars As String,result() As String) redim result(0) Dim As String var1,var2 Dim As long pst,LC=len(chars) #macro split...
by dodicat
Mar 23, 2020 20:35
Forum: General
Topic: Parse string to tree structure (solved)
Replies: 55
Views: 1490

Re: Parse string to tree structure

Hello UEZ. Windows Run this in a dedicated folder, it is literally the path instructions set alive(folders and files are created in a folder tmp then tree is called then everything is deleted) Sub string_split(Byval s As String,chars As String,result() As String) Redim result(0) Dim As String var1,v...
by dodicat
Mar 23, 2020 14:28
Forum: General
Topic: Parse string to tree structure (solved)
Replies: 55
Views: 1490

Re: Parse string to tree structure

badidea -- from your second code, and agreeing with grindstone about using only one type structure, but disagreeing about using pointers. function countInStr(text as string, char as string) as integer dim as integer count = 0 for i as integer = 0 to len(text) - 1 if text[i] = asc(char) then count +=...

Go to advanced search