Search found 911 matches

by SARG
Dec 08, 2019 10:41
Forum: General
Topic: Duplicate Definition
Replies: 1
Views: 51

Re: Duplicate Definition

Hi Dinosaur, Obviously the test for 'once' is done on the full path. You could have your own include file with same name containing a different code not colliding with files from lib. Or many of your files with same name (not a good idea...). #include once "d:\dino1\sub/simple2.bas" ''cont...
by SARG
Nov 27, 2019 16:50
Forum: Windows
Topic: How to get the message time from message structure ?
Replies: 8
Views: 398

Re: How to get the message time from message structure ?

Hi, Use the GetTimeFormat function, a WDS api. If you need more do not hesitate. Extract from SDK reference : The GetTimeFormat function formats a time as a time string for a specified locale. The function formats either a specified time or the local system time. int GetTimeFormat( LCID Locale, // l...
by SARG
Nov 13, 2019 8:55
Forum: Tips and Tricks
Topic: Itemmanager
Replies: 3
Views: 251

Re: Itemmanager

Hi,

Just 2 remarks :
- in the "set" function it's useless to set again the name if the item already exists as it's the key to access to the data ....
- probably better, to optimize, to increase the size of the array by 10 or 100 depending the possible number of inputs.
by SARG
Nov 08, 2019 8:11
Forum: Community Discussion
Topic: Program runs twice in Windows 10
Replies: 2
Views: 178

Re: Program runs twice in Windows 10

It could be the antivirus. Mine, Avast, does that. First time the exe is running in a sand box then it runs normally. And after as the exe have been checked it runs one time. There should be a different windows/frame to indicate the treatment by the antivirus. Try (temporary) deactivating the antivi...
by SARG
Nov 06, 2019 10:14
Forum: Community Discussion
Topic: variadic functions and argument lists in fbc
Replies: 25
Views: 7631

Re: variadic functions and argument lists in fbc

@coderjeff From FB manual, ...(ellipsis) : "In the procedure body, Cva_List data type, and Cva_Arg marco can be used to expand the ellipsis parameter (...) to obtain the values of the arguments passed to the variadic procedure. The argument list, once initialized with Cva_Start or copied with C...
by SARG
Nov 05, 2019 9:44
Forum: General
Topic: count of digits in large number
Replies: 5
Views: 230

Re: count of digits in large number

Hi Change log(10(n)) by log (n) Edit : note natural logarithm, divide by log(10) if the need is logarithm of base 10 function countDigit(n As Ulongint) As Integer return INT((log(n)/log(10)) + 1) end function Dim As Integer n input "Enter number: ";n print countDigit(n) sleep
by SARG
Oct 29, 2019 22:27
Forum: General
Topic: Line Input fail
Replies: 12
Views: 360

Re: Line Input fail

Hi Dinosaur,

Don't know if this can help. Just gives the same error, maybe a clue.

Code: Select all

#undef line
sub line(t as long, s as string)
   
end sub
dim as long pf
dim as string chrs
line input #PF,chrs
by SARG
Aug 27, 2019 10:23
Forum: Community Discussion
Topic: FreeBASIC 1.07 Release Discussion
Replies: 43
Views: 6606

FreeBASIC 1.07 Release Discussion

Discussion of FreeBASIC 1.07.x releases, issues, comments, remarks, etc. Full release announcement is posted at Version 1.07.0 released . Original opening post follows. Sorry SARG, this is a good topic to commandeer for the discussion :) -- Jeff ---- Hi coderJeff, Thanks for this new version. The l...
by SARG
Jul 27, 2019 19:05
Forum: General
Topic: No warning if a select case as const value are out of range compiler crash !
Replies: 12
Views: 5104

Re: No warning if a select case as const value are out of range compiler crash !

Hi SARG. Well after a coffee and a scone it still wasn't compiled. I had to go to my other fbide (for 64 bits) with shell "taskkill /F /IM "+ "fbc.exe /T" And put this file into the fb directory. It killed it stone dead, but I won't be re-trying your snippet anytime soon. Hi dod...
by SARG
Jul 27, 2019 17:01
Forum: General
Topic: No warning if a select case as const value are out of range compiler crash !
Replies: 12
Views: 5104

Re: No warning if a select case as const value are out of range compiler crash !

Very funny I tried the code below (fbc 1.06 32bit). Compilation was very long but all works fine. There are more than 2millions lines in the asm file..... Exe size # 8Mo The jump table is very big. I guess limits are not well tested in some cases. dim as integer IT=3000000 const cst1 =1000000 const ...
by SARG
Jul 22, 2019 23:00
Forum: Beginners
Topic: Why wrong length of array
Replies: 8
Views: 4036

Re: Why wrong length of array

If "length of s is:" should show the number of words you need to add one to the ubound as it's zero based..

Code: Select all

print "length of s is: "; ubound(S)+1
by SARG
Jul 22, 2019 9:15
Forum: Documentation
Topic: Hello fxm :-) => for updating the ASM documentation page on wiki
Replies: 15
Views: 6112

Re: Hello fxm :-) => for updating the ASM documentation page on wiki

@D.J.Peters ...I would post later for Linux later. :-( Sorry to be so late. I forgot my reply .... Windows ABI ----------- params : rcx,rdx,r8,r9 + xmm0 to xmm3 Space for these registers also reserved on the stack to store them at the beginning of proc. Important note : if the first arg is an integ...
by SARG
Jun 27, 2019 8:03
Forum: General
Topic: mingw_stdio example
Replies: 13
Views: 2267

Re: mingw_stdio example

@SARG thanks a million for your fine detective work :-) One thanks was enough :-) a take it that if the return type were one of FB's built-in types it would work. Sure I tested this and it works fine. declare function sin2 cdecl alias "sin" (byval c as double) as double dim as double sdou...
by SARG
Jun 26, 2019 20:29
Forum: General
Topic: mingw_stdio example
Replies: 13
Views: 2267

Re: mingw_stdio example

your declarations are very similar to my next to last post, tested ok both 32 and 64 bit Sorry I missed your post and caseih's one. sadly, the same approach won't work for functions like sinl, it works ok in 64-bit but not in 32-bit, apparently, there are some differences between linux cdecl and wi...
by SARG
Jun 25, 2019 21:03
Forum: General
Topic: mingw_stdio example
Replies: 13
Views: 2267

Re: mingw_stdio example

Hi srvaldez, No need naked subs : just use declare with alias, simplier.... 32bit tested but maybe declares should be added for 64 bit. #include "crt/longdouble.bi" declare sub sprint_ cdecl Alias "__mingw_sprintf" (byval s As zstring ptr,byval frmt as zstring ptr,byval c as clon...

Go to advanced search