Hi Qlemo,
Thanks.
How do I put this is my code?
I have this:-
I would like it to appear like this:-
target = "17*140 TORUS SKIRT 2.4M 4PCS (12) PEFC MIN 70% EAN"
ReplaceToken msLabelTemplate, "@LABEL6@", "17*140 TORUS"
ReplaceToken msLabelTemplate, "@LABEL7@", "SKIRT 2.4M 4PCS"
ReplaceToken msLabelTemplate, "@LABEL8@", "(12) PEFC MIN"
ReplaceToken msLabelTemplate, "@LABEL9@", "70% EAN"
The LABEL names are hardcoded 6-9. I just need to incorporate your code into this.
Any ideas?
many thanks
Stuart
Main Topics
Browse All Topics





by: QlemoPosted on 2009-10-28 at 10:26:52ID: 25685858
I recommend to use the Split function to create an array of strings, split on space:
splits = Split(varMainString)
In a loop, add the next string fragment to the previous, and look if it 15 max. If not, do not add, and use next var (best again as an array):
Dim target(4)
j = 0
for each x in splits
if len(target(j)+x) > 14 then
j = j+1
else
target(j) = target(j) + " " + x
end if
next i
Then you only need to use target(0) etc.