Search found 589 matches

by grindstone
Dec 18, 2018 9:56
Forum: General
Topic: No type check of UDT array's bug or feature ?
Replies: 5
Views: 122

Re: No type check of UDT array's bug or feature ?

D.J.Peters wrote:I can't believe I never was run in to this pitfall before, I use FB since 2005. :-)
That's the disadvantage of a clean programming style. <grin>
by grindstone
Dec 16, 2018 15:41
Forum: General
Topic: Let-operator missing when exiting Sub(byref casted)? [solved]
Replies: 4
Views: 62

Re: Let-operator missing when exiting Sub(byref casted)?

I'm not quite sure if I've got you right, but with

Code: Select all

...
Sub Test (ByRef x As UDT)
...
it works.
by grindstone
Dec 15, 2018 9:26
Forum: General
Topic: Which method better (faster)? Array of Strings or Ubytes?
Replies: 13
Views: 156

Re: Which method better (faster)? Array of Strings or Ubytes?

From my experience indexed string access is the fastest way to access single bytes in a bunch of data. In many cases it's even worth the efford to convert the data to a string, compute it and convert it back. For example this is the function I use to amplify .wav files in 32bit float format: Functio...
by grindstone
Dec 14, 2018 0:31
Forum: Game Dev
Topic: Single Developer Games !
Replies: 5
Views: 191

Re: Single Developer Games !

I'm impressed, especially by the rollercoaster sim.
by grindstone
Dec 13, 2018 9:07
Forum: Game Dev
Topic: Making heatMaps more Dynamic
Replies: 37
Views: 392

Re: Making heatMaps more Dynamic

@leopardpm

A little hint: The Sub/Function declarations in your code are completely needless. A procedure has only to be declared if it is called before it's defined in the source code.
by grindstone
Dec 11, 2018 9:28
Forum: General
Topic: Anyone have good code for making a Priority Queue?
Replies: 19
Views: 316

Re: Anyone have good code for making a Priority Queue?

Yes, it was a lot of work, and it took a lot of brainpower - when I coded the template of this a few years ago: A search tree list to maintain my music collection <smile>. This time it was not so hard. If you have a closer look at the code you will see that most of the procedures are quite similar, ...
by grindstone
Dec 11, 2018 1:32
Forum: General
Topic: Anyone have good code for making a Priority Queue?
Replies: 19
Views: 316

Re: Anyone have good code for making a Priority Queue?

Alright, here's my 2nd attempt, a 5 level binary tree. Not completed yet, but already enough to play around with: Type tEndNode As Integer frontX = 0 As Integer frontY = 0 As Boolean valid = FALSE End Type Type tPathNode As tPathNode Ptr child(0 To 255) End Type Type tPreEndNode As tEndNode Ptr chil...
by grindstone
Dec 11, 2018 0:26
Forum: General
Topic: Anyone have good code for making a Priority Queue?
Replies: 19
Views: 316

Re: Anyone have good code for making a Priority Queue?

Another question: Are there negative values?
by grindstone
Dec 10, 2018 11:06
Forum: General
Topic: Anyone have good code for making a Priority Queue?
Replies: 19
Views: 316

Re: Anyone have good code for making a Priority Queue?

Like I said, my posted code is only a 1st approach (quick and dirty). I once implemented a search tree for strings, including a fast search function. Please give me some time to recode.

What do you want to get fast: A certain index or a certain value?
by grindstone
Dec 09, 2018 16:03
Forum: Tips and Tricks
Topic: Insert/Replace String procedures
Replies: 38
Views: 755

Re: Insert/Replace String procedures

Maybe you should DIM 'ContentNew' as a ZString Ptr instead of a String Ptr, as well as the return value of ReplaceAllJ. Furthermore you're submitting different pointer types to SaveFilePtr (String Ptr as Any Ptr). You should only use ZString pointers when you're working with the WinAPI.
by grindstone
Dec 09, 2018 15:25
Forum: General
Topic: Anyone have good code for making a Priority Queue?
Replies: 19
Views: 316

Re: Anyone have good code for making a Priority Queue?

IMHO the fastest way to get a sorted list is to implement it as a chained list of UDTs. I've already done something similar, but for strings, not for integers. To give you an idea what I'm talking of, here a quick and dirty 1st approach: Type tFrontier prevNode As Any Ptr nextNode As Any Ptr frontCo...
by grindstone
Dec 09, 2018 12:59
Forum: Tips and Tricks
Topic: Insert/Replace String procedures
Replies: 38
Views: 755

Re: Insert/Replace String procedures

@jj2007: You used the wrong value to calculate 'diff' : Function ReplaceAllJ(ByRef s1 As String, ByRef s2 As Const String, ByRef s3 As Const String) As ZString Ptr ' in <s1> replace all occurrences of <s2> by <s3> Dim As Integer posx=0, posPrevious, ct=0, diff, l2=Len(s2), l3=Len(s3) Dim As Any Ptr ...
by grindstone
Dec 04, 2018 23:59
Forum: Community Discussion
Topic: Nominations for Forum Moderators
Replies: 42
Views: 1903

Re: Nominations for Forum Moderators

dodicat wrote:I would volunteer to help with nasty members North of the border (The English border) if you like, in the form of home visits.
Could it be you *slightly* misunderstood the tasks of a moderator? <grin>
by grindstone
Nov 27, 2018 21:26
Forum: General
Topic: Is there existing an inputroutine?
Replies: 28
Views: 566

Re: Is there existing an inputroutine?

@grindstone Works great except for the delete key. To replicate the problem type abcdefg, left key to 'd' and press delete. The 'd' is replaced by 'abc'. Adding 'Locate ze, co, 0' on line 198 after the text is rebuilt, fixes the problem. That is the same line used in the backspace code. Thank you, ...
by grindstone
Nov 26, 2018 1:12
Forum: General
Topic: Is there existing an inputroutine?
Replies: 28
Views: 566

Re: Is there existing an inputroutine?

Added a password mode. stringmod.bi: Type tJoyBack up_ As String right_ As String down_ As String left_ As String End Type Dim Shared tJoyBackZero As tJoyBack Declare Operator = (jr1 As tJoyBack, jr2 As tJoyBack) As Integer Operator = (r1 As tJoyBack, r2 As tJoyBack) As Integer If r1.up_ <> r2.up_ T...

Go to advanced search