Results 1 to 11 of 11

Thread: new to vbscript

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    North East (UK)
    Posts
    204

    Question new to vbscript

    Hi All,

    I am new to using vbscript and I am having a problem making this small script work. Can anybody see what I am doing wrong.

    Many Thanks

    Colin

    <SCRIPT LANGUAGE= "VBScript">
    <! - - Option Explicit '<- Problem appears to be here.

    Sub cmdcalculate_OnClick()

    Dim value1
    Dim value2
    Dim value3
    Dim total

    value1 = txtvalue1.value
    value2 = txtvalue2.value
    value3 = txtvalue3.value
    total = value1 + value2 + value3

    End Sub

    - - >
    </SCRIPT>

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Try :

    Code:
    <SCRIPT LANGUAGE= "VBScript"> 
    <!-- 
    Option Explicit
    
    Sub cmdcalculate_OnClick() 
    
        Dim value1 
        Dim value2 
        Dim value3 
        Dim total 
        
        value1 = txtvalue1.value 
        value2 = txtvalue2.value 
        value3 = txtvalue3.value 
        total = value1 + value2 + value3 
    
    End Sub 
    --> 
    </SCRIPT>
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3
    chenko
    Guest
    Leave Option Explcit out, I dont suggest using it for Client Side scripting.

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Why pray tell ?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  5. #5
    chenko
    Guest

    Unhappy Format?

    How can I format any date to dd/mm/yy format in ASP? it seams to have the Format() Function missing

  6. #6
    chenko
    Guest
    I clicked new threaD?

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    North East (UK)
    Posts
    204
    Many thanks, that did the trick

    Colin

  8. #8
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Originally posted by chenko
    I clicked new threaD?
    Yeah I was wondering what was going on
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  9. #9
    chenko
    Guest
    Originally posted by colin
    Many thanks, that did the trick

    Colin
    Mine?

    Jamie !!!

    Ive had that happen to me a few times now

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    North East (UK)
    Posts
    204
    both worked ok,

    cheers

  11. #11
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Chenko- use formatdatetime
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width