Zum Hauptinhalt gehen

Suche

Suche

Function Syntax Error 6900

Kommentare

4 Kommentare

  • Avatar
    Legacy Poster

    Can you use a Case statement all together? You may not need to create a function.

    0
  • Avatar
    Shotaro Ito

    What sai told is like this:

     

    In more options(transform) > VB Script > OnProcessData,

    ms = ""
    Select case Value
      Case  0: ms = "0"
      Case  1: ms = "A"
      Case  2: ms = "B"
      Case  3: ms = "C"
      Case  4: ms = "D"
      Case  5: ms = "E"
      Case  6: ms = "F"
      Case  7: ms = "G"
      Case  8: ms = "H"
      Case  9: ms = "I"
      Case 10: ms = "J"
      Case 11: ms = "K"
      Case 12: ms = "L"
    End Select
    Value = ms
    

    "Value" is the value of this data source. 

    From BarTender 10.0, you could create such condition without script - by Search and Replace transform.

    0
  • Avatar
    Legacy Poster

    Sai, Shotaro,

     

    Thank you.

     

    This definately worked. I understand the fnction would have been redundant, but I still don't understand why it would not work as it was written. I would like to figure it out incase I need to use the Funtion command in the future.

    0
  • Avatar
    Legacy Poster

    To troubleshoot, try simplifying your code. And work up from there i.e.

     

    Dim MonthLetter(1)

    MonthLetter(0) = 0

    Function GetMonthLetter()

     GetMonthLetter = MonthLetter(0)

    End Function

    Value = GetMonthLetter()

     

    You will notice this code will fail because you are missing " " around your

    MonthLetter(0) = "A"

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.