Search found 11 matches

by PeterJ
Fri Mar 03, 2017 12:00 pm
Forum: General Discussion
Topic: Map - search algorithm
Replies: 3
Views: 2108

Re: Map - search algorithm

Simplistic description of MAPS: If you save/retrieve via a map key, it is translated via a hash routine in a real number, which is used to identify the storage location. As you can imagine the translation of the map key doesn't create a unique numer, there migth be collisions, which mean an ...
by PeterJ
Thu Feb 23, 2017 3:46 pm
Forum: General Discussion
Topic: Another Pre Processor
Replies: 4
Views: 3489

Re: Another Pre-Processor--Syntax Checker issue

Resurrecting an old thread--I was looking for a preprocessor/precompiler to use "variable constants" at compile time, and ran into this.

I tested it with the modified Version again and it smoothly fitted into PB RUN/Create Exe processes. I checked the Tool settings again, there might be a problem ...
by PeterJ
Thu Feb 23, 2017 3:38 pm
Forum: General Discussion
Topic: Another Pre Processor
Replies: 4
Views: 3489

Re: Another Pre-Processor--Syntax Checker issue

Resurrecting an old thread--I was looking for a preprocessor/precompiler to use "variable constants" at compile time, and ran into this.

Is anybody else using this version? It does not seem to work with pb5--it acts as if the Syntax Checker is running before the precompiler does, so I get syntax ...
by PeterJ
Wed Feb 22, 2017 3:17 pm
Forum: Coding Questions
Topic: Macro parameter: determine empty value
Replies: 3
Views: 1842

Re: Macro parameter: determine empty value

I don't know a way to distinct a literal from a variable as after compiling they are both given values.
So the following code distincts only between given and not given using a default argument.
enableExplicit
Macro DQ()
"
EndMacro
#EMPTYSTRING="~"
Macro MyMacro(p=#EMPTYSTRING)
if p=#EMPTYSTRING ...
by PeterJ
Wed Feb 22, 2017 11:10 am
Forum: Coding Questions
Topic: Macro parameter: determine empty value
Replies: 3
Views: 1842

Macro parameter: determine empty value

I try to find a reliable way, if a Macro parameter is set, or empty or contains the default value. Reason I want to treat the coding to be produced depending on it. I tried several proposals, but couldn't find a solution, which suits all variations. Maybe I overlooked something and someone has a ...
by PeterJ
Wed Apr 27, 2016 5:47 am
Forum: Coding Questions
Topic: Simple Question on Inline ASM
Replies: 22
Views: 7090

Re: Simple Question on Inline ASM

Congrats Danilo, this is really nice coding!
by PeterJ
Tue Apr 26, 2016 1:55 pm
Forum: Coding Questions
Topic: Simple Question on Inline ASM
Replies: 22
Views: 7090

Re: Simple Question on Inline ASM

I personally think a "gosub"-like function within procedures has some benefits:
- it allows to structure complex coding, by doing perform step1, perform step2, etc. and keep the called sub procedures separate
- it allows to re-use coding where just some "input"-variables change, without duplicating ...
by PeterJ
Wed Jan 14, 2015 9:27 am
Forum: Coding Questions
Topic: Dynamic Multi Arrays
Replies: 6
Views: 3021

Dynamic Multi Arrays

I had the use of dynamic multi arrays (matrixes). Neither number of matrixes, nor their dimensions are known in the program (I use it to play with matrix arithmetic). As described in http://www.purebasic.fr/english/viewtopic.php?f=13&t=57067&hilit=dynamic+Arrays it is possible to emulate a multi ...
by PeterJ
Thu Nov 20, 2014 3:14 pm
Forum: Coding Questions
Topic: Passing string to DLL truncates to first character
Replies: 4
Views: 2118

Re: Passing string to DLL truncates to first character

... there is always something :cry:
This was exactly the reason! Thanks for quick any easy solution!
Now my DLL perfectly runs !

Peter
by PeterJ
Thu Nov 20, 2014 2:46 pm
Forum: Coding Questions
Topic: Passing string to DLL truncates to first character
Replies: 4
Views: 2118

Passing string to DLL truncates to first character

Hello,

when passing a string to a DLL (also PB), only the first character is received in the DLL. I was able to reproduce it with one of the Help examples:

Prototype.i ProtoMessageBox(Window.i, Body$, Title$, Flags.i = 0)
If OpenLibrary(0, "User32.dll")
MsgBox.ProtoMessageBox = GetFunction(0 ...
by PeterJ
Fri Jun 11, 2010 8:53 am
Forum: General Discussion
Topic: Another Pre Processor
Replies: 4
Views: 3489

Another Pre Processor

* modified 23. February 2017 unicode compatible
In some situations an extended pre compiler support would be useful. I specially missed CompilerGoto, CompilerSet and labels, these additional functions would allow iterativ code line generation.
As the PB Editor greatly allows the integration of your ...