Search found 5985 matches

by dodicat
Dec 08, 2019 22:53
Forum: Community Discussion
Topic: Suddenly FB executables are detected as Trojans
Replies: 2
Views: 62

Re: Suddenly FB executables are detected as Trojans

I have to make fbc.exe, gcc.exe, fbidetemp.exe exceptions in Avira antivirus win 10, otherwise they would never run. You can easily produce false positives yourself during coding, especially if you are using winApi functions. I have loads of them in quarantine, I get a couple of sharp beeps, a big r...
by dodicat
Dec 08, 2019 22:32
Forum: General
Topic: Squares
Replies: 7357
Views: 442373

Re: Squares

You just cast the long to ulong. (use culng)

Code: Select all



dim as string s=string(4,0)

for n as long=1 to 20
   
    s[0]=rnd*255:s[1]=rnd*255:s[2]=rnd*255:s[3]=rnd*255
   
print s, cvl(s),culng(cvl(s)),mkl(culng(cvl(s)))
print
next
sleep
 
by dodicat
Dec 08, 2019 9:22
Forum: General
Topic: Squares
Replies: 7357
Views: 442373

Re: Squares

Hi Albert. I have been following your compressor, but have been messing with other stuff also. To permute you can either write some code to cycle a string, but I had this old code to do it a different way. Sub Permutate(Byval s2 As String,perm() As String,OptionalStop As String="") Dim As ...
by dodicat
Dec 07, 2019 19:48
Forum: General
Topic: Preprocessor question
Replies: 16
Views: 355

Re: Preprocessor question

Thanks fxm. Here is a test of a good ide. fbide opens the offending include file (fbgfx.bi in this case), and shows the path to this include file at the top. All the other ides I tested just show the compile error. dim as long x=1 #macro test #if typeof(x)=long #include "fbgfx.bi" #endif #...
by dodicat
Dec 07, 2019 18:27
Forum: General
Topic: Preprocessor question
Replies: 16
Views: 355

Re: Preprocessor question

Off topic. I also have a preprocessor question. The help file for #if extract; This conditional directive differs from the If conditional statement in that #if is evaluated at compile-time and If is evaluated at run-time. But here in this snippet it looks like #if is being evaluated at run time. #ma...
by dodicat
Dec 07, 2019 13:39
Forum: General
Topic: Checking if an array is empty.
Replies: 5
Views: 155

Re: Checking if an array is empty.

The getsize macro is quite robust. #macro GetSize(array,d) d=Ubound(array,0) For n As Integer=1 To d If n=1 Then d=1 d=d*(Ubound(array,n)-Lbound(array,n)+1) Next d=d*Sizeof(array) #endmacro dim as long size Dim As Integer a() ReDim a(10 To 20) getsize(a,size) print size;" bytes" redim as i...
by dodicat
Dec 06, 2019 20:04
Forum: General
Topic: Preprocessor question
Replies: 16
Views: 355

Re: Preprocessor question

Sorry Badidea, didn't quite get your request. You could simply define your path as the folder without the end quote. and put the end quote at the end of #include. example #define path "C:\Users\User\Desktop\New folder #include path\fbgfx.bi" #include path\document.bi" using fb sleep T...
by dodicat
Dec 06, 2019 1:35
Forum: General
Topic: Preprocessor question
Replies: 16
Views: 355

Re: Preprocessor question

In windows you can define a path.

Code: Select all



#define pathtobi  "C:\Users\User\Desktop\New folder\fbgfx.bi"

#include pathtobi

screenres 400,400,32,,fb.GFX_ALPHA_PRIMITIVES

circle(100,100),100,rgba(200,0,0,100),,,,f
circle(200,100),100,rgba(200,0,0,100),,,,f
sleep


sleep
by dodicat
Dec 03, 2019 20:42
Forum: General
Topic: c qsort compare callback as member function?
Replies: 14
Views: 414

Re: c qsort compare callback as member function?

Hi caseih I didn't pass any udt pointers in my code. I just prefer straight udt's when it is possible. But if the callback is to be a method then I think I have a measure of qsort_s Simple example using the extra pointer to determine sort direction. (Get a warning though) extern "c"...
by dodicat
Dec 03, 2019 18:40
Forum: General
Topic: c qsort compare callback as member function?
Replies: 14
Views: 414

Re: c qsort compare callback as member function?

A disadvantage of a static method is that you have no access to THIS But if you pass a udt to it, you have access to THIS once more. I can't think of an easier way to make a static method SEEM like a non static method. #include "crt/stdlib.bi" #include "file.bi" '========= set up...
by dodicat
Dec 03, 2019 13:18
Forum: Community Discussion
Topic: Sharing some good news :-)
Replies: 9
Views: 515

Re: Sharing some good news :-)

Well done.
Well written fb looks cool and runs well.
You forum contributions are all in this category.
by dodicat
Dec 03, 2019 13:14
Forum: Projects
Topic: Shaders from shadertoy.com on old OpenGL 2.x gfx cards.
Replies: 7
Views: 322

Re: Shaders from shadertoy.com on old OpenGL 2.x gfx cards.

intel graphics on motherboard (crap!) My system Card: GDI Generic Manufacturer Microsoft Corporation OpenGL Version 1.1.0 EXTENSIONS: 1 GL_WIN_swap_hint| 2 GL_EXT_bgra| 3 GL_EXT_paletted_texture| Press any key to continue . . . So with your code I get glActiveTexture press any key ... in the ErrorEx...
by dodicat
Dec 03, 2019 12:27
Forum: General
Topic: (Solved) How to sort datasheet (x-dim array) by a few columns (at once in 1 loop) ?
Replies: 23
Views: 794

Re: How to sort datasheet (x-dim array) by a few columns (at once in 1 loop) ?

Example of saving to file: #include "crt/stdlib.bi" #include "file.bi" '========= set up c sort ========= #define up <,> #define down >,< #define ArrayToSort(x,start,finish) @X((start)),((finish)-(start)+1),Sizeof(X) #macro SetCSort(Datatype,FnName,b1,b2,dot) Function FnName Cdec...
by dodicat
Dec 03, 2019 10:03
Forum: General
Topic: (Solved) How to sort datasheet (x-dim array) by a few columns (at once in 1 loop) ?
Replies: 23
Views: 794

Re: How to sort datasheet (x-dim array) by a few columns (at once in 1 loop) ?

I also like badidea's reasoning. To sort only part of an array with qsort you say from which lower element to which upper element within the array. I am sure that badidea can incorporate this feature in his method. But here is my own method with choices on the fly. (I keep select case out of the cal...
by dodicat
Dec 02, 2019 18:07
Forum: Beginners
Topic: String Processing
Replies: 10
Views: 372

Re: String Processing

If you use inputfile=command(1), then you have drag and drop. You can format the outputfile name any way you like (within the realms of common sense). #include "vbcompat.bi" dim as string Content dim as string InputFile="results.txt" var x= format(now,"yyyymm") dim as s...

Go to advanced search