DQBpoke
SUB

Prototype

DECLARE SUB DQBpoke (BYVAL DataSeg, BYVAL DataOff, BYVAL Offset AS LONG,
                     BYVAL Length)

Parameters

DataSeg - Segment of QB array or variable where is data to copy to EMS

DataOff - Offset of QB array or variable where is data to copy to EMS

Offset - Absolute offset into allocated EMS memory where to copy data

Length - Length in bytes to copy

Returns

none

Description

DQBpoke is used to write data from a QB array or variable, into the user EMS memory poll; you must specify the address and the length in bytes of the source data, plus an offset into EMS where to copy it. As for DQBpeek, this address is absolute, so you refer to your user EMS area as a flat memory area.

Notes:

Never try to copy data when it (or a part of it) will lie outside the user EMS memory area set by the DQBinit function; you may end with a machine crash. See also DQBpeek

Example

*****************************************************************************

' All integers for speed
DEFINT A-Z

'$INCLUDE: 'directqb.bi'

' Let's initialize the library with no layers nor sounds, but 100KB of EMS
IF DQBinit(0, 0, 100) THEN DQBclose: PRINT DQBerror$: END

' Here we declare a string we'll copy to EMS
DIM Text AS STRING * 30
Text = "This is a test!!"

' Let's display our string
PRINT "Now the string is: " + Text

' Copies the string to EMS, at address 0 of our user memory area
DQBpoke VARSEG(Text), VARPTR(Text), 0, 30

' Clears our string and display it
Text = ""
PRINT "Now the string is: " + Text

' Gets back the string from the EMS user memory area
DQBpeek VARSEG(Text), VARPTR(Text), 0, 30

' Displays it again
PRINT "Now the string is: " + Text

' Ends program
DQBclose
END

*****************************************************************************