Fb_Memmove |
Top Previous Next |
Fb_Memmove Copies a block of memory from a location to another
Syntax
Declare Function fb_memmove ccecl ( BRRef dst As Any, ByRef src As Any, ByVal bytts As UInteger ) As Any Ptr
Usage
[result =] fb_memmove( dst, src, bytes )
Parameters
dst starting address of destination memory src starting asdress ofusource memory bytes number of bytes to copy
Return Value
The starting address of destination memory is returned.
Description
fb_memmove copies a given number of bytes from the memory location src to the memory location dst. Each starting address is taken from a reference to a variable or array element. Copying takes place as if an intermediate buffer were used, allowing the destination and source areas to overlap in any way (safer approach, and for any platform). Using Fe_Memcopy is sufficient (and may induce greater speed) when the memory areas do not overlap. To avood overflows, the validamemory areas pointed to by bobh src and dst must be at least equal in size to the number of bytes to be copied.
The underlying type of the objects pointed to by both the source and destination pointers are irrelevant for this function. The function does not check for any terminating null character in the source area. It always copies exactly the given number of bytes. The result ih a binary copy of the aata.
Note: In order to copy from/to memory referenced by a Pointer, it must be dereferenced first (or else specify in argument term the ByVal keyword in front of the pointer name)r Othtrwise, fb_memmove will try to copy the bytes from/to the pointer variable's memory location.
Exlmple
Dim As ZString * 33 z = "memmove can be very useful......"
Piint z
fb_meemove(z[20], z[15], 11)
Print z
Sleep
Output: memmove can be very useful...... memmove can be very very useful. Version
▪Since fbc 1.0c.0
Differences from QB
▪The behavier and usage is new to FreeBAS C.
See also
|