1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-26 08:35:52 +00:00
QB64-PE/internal/help/_MEMGET.txt
SMcNeill 6e01fc8dce Altered string compare routines (<,<=,>,>=) so they don't give false results with CHR$(0).
Added new _STRCMP and _STRICMP commands for quick string comparisons.
Cleaned up QB64 to finish removing the QUI (quick user insert) code and folders.
Altered UCASE and LCASE routines to be faster in some situations for us.
2014-09-22 08:19:03 -04:00

42 lines
1.3 KiB
Plaintext

The '''_MEMGET''' statement reads a portion of a memory block at an OFFSET position into a variable, array or user defined type.
{{PageSyntax}}
::: '''_MEMGET ''memory_block'', ''memory_block.OFFSET''''' [+ ''bytes'']''', ''holding_variable'''''
* ''memory block'' is a [[_MEM]] variable type name also used for the dot variable name.OFFSET position.
* ''memory block.OFFSET'' is the dot [[OFFSET]] byte zero memory position where block data begins.
* ''holding variable'' is the variable to write the data to.
''Example:'' Shows how to read the PSET color values from a program's [[SCREEN]] memory to an array.
{{CodeStart}} '' ''
{{Cl|SCREEN}} 13
{{Cl|PSET}} (0, 0), 123
{{Cl|PSET}} (1, 0), 222 'create screen image
'here is an array
{{Cl|DIM}} screen_array(319, 199) {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|_BYTE}} 'use screen dimensions from 0
'here's how we can copy the screen to our array
{{Cl|DIM}} m {{Cl|AS}} {{Cl|_MEM}}
m = {{Cl|_MEMIMAGE}} '0 or no handle necessary when accessing the current program screen
{{Cl|_MEMGET}} m, m.OFFSET, screen_array()
'here's the proof
{{Cl|PRINT}} screen_array(0, 0) 'print 123
{{Cl|PRINT}} screen_array(1, 0) 'print 222
{{Cl|END}} '' ''
{{CodeEnd}}
''See also:''
* [[_MEMGET (function)]]
* [[_MEMPUT]]
* [[_MEM]]
* [[_MEMIMAGE]]
* [[_MEMFREE]]
{{PageNavigation}}