Yeah, I suppose I wanted to have the option of either assigning the parameter before the function call or within it. I hoped this would have worked... private void SomeFunc(out string TStr) { if(TStr == null) TStr = ""; } But of course it doesn't. No worries ... I'll just use ref ... Thanks anyway.
M
MarkyBoy768
@MarkyBoy768
Posts
-
Test If Out Parameter has been assigned -
Test If Out Parameter has been assignedI thought I understood how Out worked until I found out that you could pass a value through to the function with it. In other words the out parameter can be assigned before the function call. The compiler insists that the parameter is assigned before return even though it could have been assigned prior to the function call. I suspect the answer is no - but is there any way to test if the parameter is assigned and if so get it's value. This would be useful.