I have an encryption method that on decryption returns the results as a Xojo.Core.MemoryBlock. In Debug I can see both the returning variable I created and the return value (ie just before it exits the method) and this contains the correct text, but the Xojo.Core.MemoryBlock that collects the returning value contains random junk ie not the same text at all.
Yet, if I return a Base64 of the Xojo.Core.MemoryBlock as Text instead, then decode it outside the method the text is OK.
Is it OK to have Xojo.Core.MemoryBlock as a Return type, or is it unreliable?
What happens if you create the MB outside the method and pass it ByRef? Not saying that’s a solution, but it would tell you if it’s an issue with the MB going out of scope?