Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Memblock Help

Author
Message
Powersoft
21
Years of Service
User Offline
Joined: 1st Aug 2003
Location: United Kingdom
Posted: 3rd Jul 2004 16:45
Hello all its me.

I am need in a bit of help. i would like to know what memblocks are used for and how to use them.


cheers,

Rich


Create or Play? You choose!
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 3rd Jul 2004 18:58 Edited at: 3rd Jul 2004 19:02
Memblocks are raw data fields, which can be used for most anything. You can create images, sounds, music, databases, even levels and arrays in a memblock! The memblock is however a "RAW" access to the data, consisting of X numbers of bytes concerning the data format. For a collection of text bytes for example, you'd access the block by bytes. If a collection of integers, you'd access it by 2 bytes at a time. If a long integer, you'd access 4 bytes at a time, and so on.

Memblocks are the same as *real memory* meaning you have a pointer to a block of of data in the machine that you can pass to other functions. A large part of why memblocks exist is to call Windows DLL files, because these DLL routines often return a "chunk" of data that must stored somewhere. Take for example your modem, if may come back with;

HSP56K Fax 1.2, Class=2 US Robotics 1992

That string has to go somewhere when you call the DLL to ask the modem what type it is, and you do that by giving the DLL call the ADDRESS of a free block of memory (the memblock) where the DLL can write that string safely. Then you use the memblock commands to read the string and determine what kind of modem it is, and whether or not you can talk to it.

This is why memblocks exist, and many DLL functions need them. DLLS offer faster coding, expanded interfaces and of course, you can use memblock for making images, sounds and such as I said before. Heck, even the windows call to menu movement and mouse calls currently requires a memblock, so learning them is a good thing...

Good luck!
S.

Any truly great code should be indisguishable from magic.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd Jul 2004 19:29 Edited at: 3rd Jul 2004 19:29
Powersoft
21
Years of Service
User Offline
Joined: 1st Aug 2003
Location: United Kingdom
Posted: 3rd Jul 2004 21:43
thanks for your post,

having a look at that tut now


Create or Play? You choose!

Login to post a reply

Server time is: 2024-09-22 15:23:47
Your offset time is: 2024-09-22 15:23:47