how to clear an array?
-
good day everyone, i hope you can again help me with this: code : dim strVal() as string dim sVal as string = "a-b-c" - this can be changeable dim result as string = "" dim xCnt as integer strVal = split(sVal, "-") for xCnt = 0 to strVal -1 result & = strVal(xCnt) next first run : result = abc second run: result = abcabc <<-- this is the problem the code above runs smoothly, and no errors: but for the second runtime of the code above it does not clear the previous "strVal" value / results. how to clear the first result value of "strVal" ? thank you in advance, your help are highly appreciated. links/code are most highly appreciated thank you...:-D
start a new beginning in every ending; thats what life for......
-
good day everyone, i hope you can again help me with this: code : dim strVal() as string dim sVal as string = "a-b-c" - this can be changeable dim result as string = "" dim xCnt as integer strVal = split(sVal, "-") for xCnt = 0 to strVal -1 result & = strVal(xCnt) next first run : result = abc second run: result = abcabc <<-- this is the problem the code above runs smoothly, and no errors: but for the second runtime of the code above it does not clear the previous "strVal" value / results. how to clear the first result value of "strVal" ? thank you in advance, your help are highly appreciated. links/code are most highly appreciated thank you...:-D
start a new beginning in every ending; thats what life for......
Start with result = string.Empty at the top of the loop. You can't clear an array, it is a fixed size object.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )