cjkenworthy
Programmer
In a loop I need to: read in an array element(I) to a variable, remove all spaces and add ' ' around the value using the following code:
for I=0 to Ubound(NGNarray, 1)
dim strCurrTERMNO
dim strCurrNGN
strCurrTERMNO = TERMNOarray(I)
strCurrNGN = NGNarray(I)
Trim(strCurrTERMNO)
Trim(strCurrNGN)
'Works fine up to here, variables hold array element(I)
strCurrTERMNO = ("'" & strCurrTERMNO & "'"
strCurrNGN = ("'" & strCurrNGN & "'"
'but now variables hold eg '_2222222' where _ is whitespace.
next
how would I simply get the variable to hold 'value' without the mysterious spaces ('_value') appearing after the first ' ?
So I wish to have: eg. '2222222'
BUT I get: eg. ' 2222222'
any tips?
cheers
for I=0 to Ubound(NGNarray, 1)
dim strCurrTERMNO
dim strCurrNGN
strCurrTERMNO = TERMNOarray(I)
strCurrNGN = NGNarray(I)
Trim(strCurrTERMNO)
Trim(strCurrNGN)
'Works fine up to here, variables hold array element(I)
strCurrTERMNO = ("'" & strCurrTERMNO & "'"
strCurrNGN = ("'" & strCurrNGN & "'"
'but now variables hold eg '_2222222' where _ is whitespace.
next
how would I simply get the variable to hold 'value' without the mysterious spaces ('_value') appearing after the first ' ?
So I wish to have: eg. '2222222'
BUT I get: eg. ' 2222222'
any tips?
cheers