in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

VBScript Expression Assistance

Last post 02-22-2008 8:19 PM by abcdefghijk. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 02-22-2008 8:19 PM

    VBScript Expression Assistance

     Hi. I am trying to create a fairly complex expression field and it seems not to work. The VBScript below when run as part of a .vbs file works fine and returns the results I expect. However, the C1ReportDesigner VBScript Editor says I have a syntax error on line 2, char 1.

    I have tried declaring each variable ala option explicit, but it did no good. 

    The name of the database field is lengthMinutes.

    The name of the field I am trying to create is LengthField. I am trying to return the value using LengthField.Value (down at the end). not sure if that is the right way to do it.

    Anyway, if anyone can tell me what my syntax error is, or how to accomplish what I am trying to do, that would be fantastic

     

    here is the script:

     

    x = lengthMinutes

    h = x \ 60

    If h = 0 Then h = 12

    m = x Mod 60

    ms = String(2 - Len(CStr(m)) , "0") + CStr(m)

    thetime = CStr(h) + ":" + ms

    LengthField.Value = thetime

Page 1 of 1 (1 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.