Search found 5654 matches

by dodicat
May 07, 2019 20:38
Forum: Tips and Tricks
Topic: Modular (Binary) Exponentiation example
Replies: 4
Views: 252

Re: Modular (Binary) Exponentiation example

Dunno cbruce, it just has to be an odd number. I suppose the ones bits of the exponent is a fancy way of saying an odd number? Took me a minute to get past that bit, and spent a little while with google, like yourself, couldn't find an easy answer. Here is a string way. Agrees with your own. Also so...
by dodicat
May 04, 2019 14:41
Forum: Windows
Topic: Is there an winapi function for that
Replies: 2
Views: 125

Re: Is there an winapi function for that

This dims the desktop and puts a shield over it (can't click through it). A keyboard press clears it. Better compile to .exe with -s gui 'dimmer.bas dim as integer xres,yres screeninfo xres,yres Declare Function SLWA Alias "SetLayeredWindowAttributes" (Byval As Any Ptr, Byval As Uinteger, ...
by dodicat
May 04, 2019 11:07
Forum: General
Topic: Constructor in dll
Replies: 18
Views: 381

Re: Constructor in dll

I don't think running a function from within it's own dll is satisfactory as a rule of thumb.
You are too kind to your prospective PowerBASIC users, let them initialise things themselves.
External libs (gmp for example) require you to set up things yourself, nothing is automated there.
by dodicat
May 03, 2019 22:10
Forum: General
Topic: Constructor in dll
Replies: 18
Views: 381

Re: Constructor in dll

I was mistaken deltarho.
The gfx screen 8 failed, but other instructions are OK inside init.
Probably the same for your init sub, some instructions fail, some are OK.
I have adjusted the code above.
by dodicat
May 03, 2019 21:32
Forum: General
Topic: Constructor in dll
Replies: 18
Views: 381

Re: Constructor in dll

edit Test dll. depends what is inside init. gfx instructions seem to fail api functions seem OK 'tester.bas 'compile -dll #include "windows.bi" type udt as zstring * 20 y as integer n declare constructor declare destructor declare sub show end type constructor udt export y="The year i...
by dodicat
May 03, 2019 20:02
Forum: General
Topic: Constructor in dll
Replies: 18
Views: 381

Re: Constructor in dll

Using sub something constructor fires it up immediately, only direct instructions inside it are available (seems) If another sub is called from the constructor sub, then that other sub won't yet have actually been created, it needs to wait for the constructor sub to have run it's course. Example cal...
by dodicat
May 03, 2019 19:35
Forum: General
Topic: Constructor in dll
Replies: 18
Views: 381

Re: Constructor in dll

Just exports the methods(including constructors/destructors) The dll code 'tester.bas 'compile -dll type udt as zstring * 20 y as integer n declare constructor declare destructor declare sub show end type constructor udt export y="The year is: " n=2019 end constructor destructor udt export...
by dodicat
May 02, 2019 19:01
Forum: Community Discussion
Topic: Challenge : Sfx encrypted file, to verify it's security level
Replies: 9
Views: 342

Re: Challenge : Sfx encrypted file, to verify it's security level

Well marpon, I'm out!
sfx_challenge.exe went straight to quarantine, and on this system it is a one way ticket.(Like a black hole in the centre of Win 10)
by dodicat
May 02, 2019 13:31
Forum: Community Discussion
Topic: Please help me translate this Python code fragment to implement Steam Achievements
Replies: 21
Views: 620

Re: Please help me translate this Python code fragment to implement Steam Achievements

The steam_api.dll is OK with the functions in it.(steam_api.def) Here are my results with steam_api.dll 32 bits. (some prints are commented out, they stop the full run) test code: 'get steam_api.dll #inclib "steam_api" declare function GetHSteamPipe cdecl alias $"GetHSteamPipe" a...
by dodicat
May 02, 2019 13:31
Forum: Community Discussion
Topic: Please help me translate this Python code fragment to implement Steam Achievements
Replies: 21
Views: 620

Re: Please help me translate this Python code fragment to implement Steam Achievements

The steam_api.dll is OK with the functions in it.(steam_api.def) Here are my results with steam_api.dll 32 bits. (some prints are commented out, they stop the full run) test code: 'get steam_api.dll #inclib "steam_api" declare function GetHSteamPipe cdecl alias $"GetHSteamPipe" a...
by dodicat
May 01, 2019 21:27
Forum: General
Topic: Remove items from array without changing the order
Replies: 7
Views: 296

Re: Remove items from array without changing the order

Sometimes the old looping ways just as good. More like basic than C, and avoiding memory problems. Using fb strings by this method feels safer anyway. #macro arrayinsert(a,index,insert) If index>=Lbound(a) And index<=Ubound(a)+1 Then Var index2=index-Lbound(a) Redim Preserve a(Lbound(a) To Ubound(a)...
by dodicat
May 01, 2019 18:35
Forum: General
Topic: Remove items from array without changing the order
Replies: 7
Views: 296

Re: Remove items from array without changing the order

using memcpy #include "crt.bi" #macro arrayinsert(a,index,b) If index>=Lbound(a) And index<=Ubound(a)+1 Then Redim Preserve a(Lbound(a) To Ubound(a)+1) memcpy(@a(index)+1, @a(index), (Ubound(a)-index) * Sizeof(a(index))) Clear a(index), 0, Sizeof(a(index)) a(index)=b End If #endmacro #macr...
by dodicat
Apr 29, 2019 0:17
Forum: Beginners
Topic: Best Implementation for Set of Elements that I manually change
Replies: 14
Views: 644

Re: Best Implementation for Set of Elements that I manually change

Yes, thanks Mr Swiss, should have been close #n, a typo.
by dodicat
Apr 28, 2019 17:07
Forum: Beginners
Topic: Best Implementation for Set of Elements that I manually change
Replies: 14
Views: 644

Re: Best Implementation for Set of Elements that I manually change

Freebasic doesn't rely on a plethora of libraries (includes e.t.c) as does say, Python or Freepascal. Once you have made your own procedures to do tasks then they can be re-used. Here are some which may suit your task. Freebasic arrays are written in brackets () and are not restricted to zero based....
by dodicat
Apr 27, 2019 11:30
Forum: General
Topic: error w/gen gcc - solved
Replies: 5
Views: 269

Re: error w/gen gcc

gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC)

Go to advanced search