Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Variable Pointer Memory Storage Drop DropWild
fred = PtrPersistent(sally, objRS.GetRows())and then later want to drop that array and reuse the memory, what's the right way to do it? "*fred = 0" executes, but did it reclaim the storage?
Drop(*fred) ; reclaim the storageOr
*fred = 0 ; reclaim the storageNote: A WinBatch pointer is really just a string. But if you are concerned about it, you can set the pointer variable to zero to cause an error when subsequently dereferenced. However, doing that could cause loss of access to the 'thing' pointed to. WinBatch pointers are not the same thing as C/C++ pointers. C/C++ pointer point to chucks of heap or stack memory. WinBatch pointers are just a different way of referring to a WinBatch variable someplace in the variable table.
If you wanted to reclaim the storage AND the variable slot, the following lines are needed
Drop(*fred) ; reclaim the storage Drop(fred) ; reclaim the variable slot
Article ID: W18223
Filename: Reclaim Memory Storage from PtrPersistent.txt
File Created: 2009:07:07:08:52:32
Last Updated: 2009:07:07:08:52:32