Link to home
Start Free TrialLog in
Avatar of BILL Carlisle
BILL CarlisleFlag for United States of America

asked on

VBScript help: Loop through comma delimited string

Hi All,

I am not a VBScript guy but Dymo label is only called through VBScript:
<SCRIPT LANGUAGE=VBScript>
Sub Btn1_onclick()
  Dim DymoAddIn, DymoLabel, lAddress, lnbrOfLabels
  Set DymoAddIn = CreateObject("DYMO.DymoAddIn")
  Set DymoLabel = CreateObject("DYMO.DymoLabels")
  DymoAddIn.Open "C:\Documents and Settings\All Users\Documents\DYMO Label\Label Files\STRCToteBoxLabel.LWL"
// NEED LOOP SYNTAX
CONTINUE BOOLEAN:=true;
LOOP WHILE CONTINUE
// THIS WILL RETURN A COMMA DELIMITED LIST OF LOCATIONS, ALPHA-NUMERIC CHARACTER STRING
  lBxLabelList = getToteBarcode()  //THIS IS GOOD... JS FUNCTION THAT GETS LIST OF LOCATIONS
  IF lBxLabelList is null THEN CONTINUE = FALSE; END IF;
  lBxLabel:=SUBSTRING OR FIND OR MID ???? TO GET FIRST LOCATION IN COMMA DELIMITED LIST.
  DymoLabel.SetAddress 2, lBxLabel
  DymoAddIn.Print lnbrOfLabels, TRUE
END LOOP;
End Sub
</SCRIPT>

Thank you for your help,
Bill
SOLUTION
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Or, you can use a combination of Left and InStr....

    lBxLabel = Left(lBxLabelList, InStr(lBxLabelList, ",")-1)

Wayne
Avatar of BILL Carlisle

ASKER

Great! But can you give me the syntax for the loop too!
And how to access the split array.. I know no VB syntax... I'm javascript and PL/SQL only
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Awesome! That you both!