Search found 710 matches

by grindstone
Jul 10, 2015 9:35
Forum: General
Topic: Search binary bytes in the Big arrays
Replies: 18
Views: 1310

Re: Search binary bytes in the Big arrays

Hi guys! I'm using this hack for several purposes, just because strings are easy to handle, but I've never thought of making an object of it. That's a very interesting idea, maybe in this way it can be used to do more complex operations. But for now - thanks to your inspiration - I walked the other ...
by grindstone
Jul 09, 2015 9:00
Forum: General
Topic: Search binary bytes in the Big arrays
Replies: 18
Views: 1310

Re: Search binary bytes in the Big arrays

@VANYA: I'm pleased you like my little snippet. @caseih: Your concerns are reasonable! There shouldn't be performed any write operations on the dummy string while the pointer is redirected (at least unless you know exactly what you're doing). Especially any operation that changes the length of the s...
by grindstone
Jul 08, 2015 23:52
Forum: General
Topic: Search binary bytes in the Big arrays
Replies: 18
Views: 1310

Re: Search binary bytes in the Big arrays

Hi VANYA! With a simple trick you can use the 'InStr' - function to search for those byte patterns. It's about 5 times faster than your Boyer Moore search function. Type tStrDescr txtPtr As UByte Ptr txtLen As UInteger txtMem As UInteger End Type Dim Shared As UByte ub(&h6fffffff) ub(&h6ffff...
by grindstone
Jul 08, 2015 9:40
Forum: Hardware Interfaces / Communication
Topic: Motion Controller with Free BASIC?
Replies: 1
Views: 1514

Re: Motion Controller with Free BASIC?

There you can read until smoke comes out of your ears :-D : https://en.wikipedia.org/wiki/Motion_detector http://www.safewise.com/resources/motion-sensor-guide http://home.howstuffworks.com/home-improvement/household-safety/security/burglar-alarm2.htm http://www.elprocus.com/pir-sensor-basics-applic...
by grindstone
Jul 07, 2015 15:07
Forum: Beginners
Topic: Is there a maximum number of dimensions to an array?
Replies: 14
Views: 2097

Re: Is there a maximum number of dimensions to an array?

Luis Babboni wrote:Allocate seems is by far much slower than using arrays..... so I ´m perplexed :-/
It's not so surprising, for the array handling has been optimized for years.
by grindstone
Jul 07, 2015 14:41
Forum: Beginners
Topic: No more than 8 dimensions in Array! :-(
Replies: 31
Views: 2057

Re: No more than 8 dimensions in Array! :-(

Luis Babboni wrote:No, no, in FB.
Then "Timer" delivers a DOUBLE value with the same resolution as your system clock (~µs range).

EDIT: Sorry, I didn't notice there was a 2nd page in the meantime.
by grindstone
Jul 07, 2015 11:39
Forum: Beginners
Topic: No more than 8 dimensions in Array! :-(
Replies: 31
Views: 2057

Re: No more than 8 dimensions in Array! :-(

Are you coding in QBasic?
by grindstone
Jul 07, 2015 11:32
Forum: General
Topic: Can ScreenPtr stand for an image buffer?
Replies: 29
Views: 2085

Re: Can ScreenPtr stand for an image buffer?

Sorry, but your "screenPtr tool" is such chaotic that I can't see through even after 2 days of investigating. E.g. I still haven't found out how the contents of the "user processed images" come about. You jump across 3 or 4 subroutines mostly using global variables (with their Di...
by grindstone
Jul 07, 2015 7:48
Forum: Beginners
Topic: No more than 8 dimensions in Array! :-(
Replies: 31
Views: 2057

Re: No more than 8 dimensions in Array! :-(

A 32 bit variable claims 4 bytes of memory space, no matter if in an array or in an allocated memory block. Also an array is quite the fastest way to handle a big amount of data, combined with a convenient access management. I would strongly recommend to use an array. To save memory space, you could...
by grindstone
Jul 05, 2015 17:21
Forum: DOS
Topic: How to clear/set key in keyboard buffer ?
Replies: 2
Views: 1748

Re: How to clear/set key in keyboard buffer ?

Hello Cpcdos! I doubt that any human can type faster than a computer processes the input. It's a strange behaviour. Maybe there's something wrong with your keyboard (contact bounce)? Some time ago I wrote a sub that sends a keystroke simulation to the foreground window. Maybe it can help you. #Inclu...
by grindstone
Jul 05, 2015 17:01
Forum: Community Discussion
Topic: C code generation
Replies: 43
Views: 5107

Re: C code generation

Maybe there could be implemented a kind of '#includeC' - statement for C - sources. But that wold be a challenge for the linker.
by grindstone
Jul 05, 2015 16:42
Forum: General
Topic: Can ScreenPtr stand for an image buffer?
Replies: 29
Views: 2085

Re: Can ScreenPtr stand for an image buffer?

However, if I take ScreenPtr as a pointer to screen pixel data, and copy its content to an image, to finally display this image which is then a screen copy, I have a problem. The datas seem all to be there, but the image is sheared. Once more: Let FB do the image operations for you. If you absolute...
by grindstone
Jul 04, 2015 15:53
Forum: Community Discussion
Topic: C code generation
Replies: 43
Views: 5107

Re: C code generation

What can C do that FB can't?
That's it! Inline C would bring no benefit, other than inline ASM, which can be used in some very special cases to speed up the programme.
by grindstone
Jul 04, 2015 15:19
Forum: General
Topic: Can ScreenPtr stand for an image buffer?
Replies: 29
Views: 2085

Re: Can ScreenPtr stand for an image buffer?

I would just change one statement for it seems that the address is already an integer so why convert it. Don't know if good practice however. Code: [Select all] [Expand/Collapse] [Download] (Untitled.bas) 'layerSignal(layerIndex) = Cast(Integer, ScreenPtr()) layerSignal(layerIndex) = ScreenPtr You ...
by grindstone
Jul 04, 2015 9:36
Forum: General
Topic: Can ScreenPtr stand for an image buffer?
Replies: 29
Views: 2085

Re: Can ScreenPtr stand for an image buffer?

And I see of course no way to get the current work page at moment of routine call But it's so easy! There is an unambiguous assignment of screennumber and screenpointer. You only have to memorise the initial screenpointer, determine, to which screen it belongs and reset the current screen to this n...

Go to advanced search