Does anyone know how to turn a string, such as one;two;three into a
list, so that I can enumerate the elements in a list?
I want something like:
SET(Q one;two;three)
FOREACH(I TO_LIST(Q))
...
ENDFOREACH().
Ah, ignore me. Of course I just expand the
Try SEPARATE_ARGUMENTS.
SET(Q one;two;three)
SEPARATE_ARGUMENTS(Q)
FOREACH(I ${Q})
MESSAGE(I = ${I})
ENDFOREACH(I)
On Oct 11, 2007, at 6:42 AM, Josef Karthauser wrote:
Does anyone know how to turn a string, such as one;two;three into a
list, so that I can enumerate the elements in a list?
On Oct 11, 2007, at 6:42 AM, Josef Karthauser wrote:
Does anyone know how to turn a string, such as one;two;three into a
list, so that I can enumerate the elements in a list?
I want something like:
SET(Q one;two;three)
FOREACH(I TO_LIST(Q))
...
Try SEPARATE_ARGUMENTS.
SET(Q one;two;three)
SEPARATE_ARGUMENTS(Q)
FOREACH(I ${Q})
MESSAGE(I = ${I})
ENDFOREACH(I)
SEPARATE_ARGUMENTS do the opposite, it converts a string to a list by
replacing spaces with ;
In the case of Josef, nothing needs to be done since its string has
already