Search found 1430 matches

by STARGÅTE
Sun Sep 26, 2021 10:23 pm
Forum: Assembly Programming
Topic: [SOLVED] Trying to make AbsInt()
Replies: 12
Views: 438

Re: [SOLVED] Trying to make AbsInt()

That function is for floats and doubles. It is not made for ints. But I just did it with an integer? My dummy variable was not of double or float type. Interesting. Also the large Quads are handled correctly. But it wasn't always like that. And is dosn't work in the new c-backend Define Quad.q = -9...
by STARGÅTE
Sun Sep 26, 2021 4:52 pm
Forum: Assembly Programming
Topic: [SOLVED] Trying to make AbsInt()
Replies: 12
Views: 438

Re: Trying to make AbsInt()

Such macro in combination with ASM would work like you expected. ... Thanks for the reply. Now im even more confused, did the macro work for you? It fails on the !cmp line for me and i cant figure out why. Result is still -42 You have to compare with signed-values (JGE) instead of unsigned values (...
by STARGÅTE
Sun Sep 26, 2021 4:23 pm
Forum: General Discussion
Topic: e number calculation weird behaviour
Replies: 1
Views: 189

Re: e number calculation weird behaviour

Doubles have only ~16 precision decimal digits.
Adding 1 with 1e-16 is simple 1.
Even 1 plus 1e-12 is not precise enough to give the right result when exponential with 1e12
by STARGÅTE
Sun Sep 26, 2021 4:17 pm
Forum: Assembly Programming
Topic: [SOLVED] Trying to make AbsInt()
Replies: 12
Views: 438

Re: Trying to make AbsInt()

Such macro in combination with ASM would not work like you expected. The name "v_var" is only right if var is a global variable. If it is in a procedure it would named like p.v_var etc. I would recommend to use a normal procedure, which is fast enough: Procedure.i AbsInt(Var.i) If Var < 0 ...
by STARGÅTE
Thu Sep 23, 2021 5:46 pm
Forum: General Discussion
Topic: How to speed up ReceiveNetworkData()
Replies: 5
Views: 438

Re: How to speed up ReceiveNetworkData()

It may be a stupid question, but you use the "right way" of receiving the data? Always call NetworkClientEvent() or NetworkServerEvent() before you try to receive data. Frequently call NetworkClientEvent() or NetworkServerEvent() to avoid a network event overflow. Note, that one single Sen...
by STARGÅTE
Tue Sep 21, 2021 11:02 am
Forum: Coding Questions
Topic: Same Gadget ID's in different windows
Replies: 13
Views: 788

Re: Same Gadget ID's in different windows

On the other hand, a bound gadget event should be released when the gadget is released. I don't use bind/unbind gadget events functions and process all gadget events in main loop. Can I leave gadget events for main window gadgets in a main loop (where WaintWindowEvent() is) or it is a bad idea at a...
by STARGÅTE
Tue Sep 21, 2021 9:07 am
Forum: Coding Questions
Topic: Same Gadget ID's in different windows
Replies: 13
Views: 788

Re: Same Gadget ID's in different windows

It is normal that memory (IDs) is recycled, when objects (in this case gadgets) are released and create new ones. It happens also in other libraries like images: Define ID = CreateImage(#PB_Any, 32, 32) Debug ID FreeImage(ID) Define ID = CreateImage(#PB_Any, 32, 32) Debug ID FreeImage(ID) 37162624 3...
by STARGÅTE
Sun Sep 19, 2021 9:59 am
Forum: Feature Requests and Wishlists
Topic: [Minor request] Compiler counts useless lines
Replies: 8
Views: 739

Re: [Minor request] Compiler counts useless lines

Good hint. But if you go in this way, I would prefer to count the characters or better the tokens. Counting only the lines or characters hides the true complexity, but counting the tokens give the same value: If Decision = "Strings should also count as one." ThisIsAVeryLongVariableNameAndS...
by STARGÅTE
Sat Sep 18, 2021 2:25 pm
Forum: Applications - Feedback and Discussion
Topic: Lizard - Script language for symbolic calculations, arbitrary large and precise numbers and more
Replies: 20
Views: 6639

Re: Lizard - Script language for symbolic calculations and more

Dear all, here is the next big update for Lizard : ________________________________________ Lizard - Symbolic computation script language (Version 0.4.2-0001) Contains the Lizard.dll (Windows x64 and x86), the Lizard.so (Linux x64), the Lizard.pbi, some examples for the integration in Pure Basic and...
by STARGÅTE
Thu Sep 16, 2021 9:18 pm
Forum: Bugs - Windows
Topic: PureBasic can consume gigabytes of memory when allocating only a few object IDs
Replies: 10
Views: 994

Re: PureBasic can consume gigabytes of memory when allocating only a few object IDs

Mistrel wrote: Thu Sep 16, 2021 7:46 pm A static array is not the only way to store a lookup table.
I know. But it is the fastest, without hashing, no collision handling etc.
Having the fastest access is important, while the static index is used at anyplace.
by STARGÅTE
Thu Sep 16, 2021 7:43 pm
Forum: Bugs - Windows
Topic: PureBasic can consume gigabytes of memory when allocating only a few object IDs
Replies: 10
Views: 994

Re: PureBasic can consume gigabytes of memory when allocating only a few object IDs

Mistrel wrote: Thu Sep 16, 2021 7:40 pm I don't see why a static array needs to be used here.
How else you want to refer an index (static object number) to the allocated object location (somewhere).
The array stores all the links (addresses) to the objects.
by STARGÅTE
Thu Sep 16, 2021 7:34 pm
Forum: Bugs - Windows
Topic: PureBasic can consume gigabytes of memory when allocating only a few object IDs
Replies: 10
Views: 994

Re: PureBasic can consume gigabytes of memory when allocating only a few object IDs

If you use static numbers, the object library allocate an array with a size of the larges number. CreateImage(1000, ...) allocates an array with 1001 elements to realize the fast access of all static numbers until this number. CreateImage(1000000, ...) allocates an array with 1000001 elements... Due...
by STARGÅTE
Tue Sep 14, 2021 11:33 pm
Forum: Feature Requests and Wishlists
Topic: Allow redefinition of PureBasic functions within modules
Replies: 16
Views: 2617

Re: Allow redefinition of PureBasic functions within modules

NicTheQuick wrote: Mon Sep 13, 2021 10:19 am You can do this with Macros like this:
Wow, the combination of using modules and macros for mapping is a very elegant solution. Thanks Nic.
by STARGÅTE
Tue Sep 14, 2021 10:18 pm
Forum: Coding Questions
Topic: How to list the list in the structure knowing only the address
Replies: 3
Views: 502

Re: How to list the list in the structure knowing only the address

ChangeCurrentElement(Virtual(), *element ) can only change the direct elements in the list, not the nested ones. But you can use *element with a structure: Structure Struct Title.s List Childs.Struct() EndStructure Global num = 0 Global NewList Virtual.Struct() Global NewMap Boxes() Procedure _Add(L...