#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2002
    Posts
    2
    Rep Power
    0

    Proper syntax for Sub?


    I am working on a project that incorporates an activex control. I have a series of checkboxes that interact with that control.

    Currently, I have a function for each checkbox, which seems a little silly. I am trying to reformat the Sub to accept two parameters, but am not having any luck.

    Calling statement:
    <INPUT type="checkbox" onclick="GenToggle('Office Locations', window.document.Form1.Office)" id="Office">Office Locations

    Sub:
    Private Sub GenToggle(layername,chkname)
    Dim myMap
    Set myMap = getMap()
    If chkname.checked = True then
    myMap.getMapLayer(layername).setVisibility(1)
    myMap.refresh()
    Else
    myMap.getMapLayer(layername)setVisibility(0)
    myMap.refresh()
    End If
    End Sub

    Any help is greatly appreciated...
    Toby

    Comments on this post

    • JimmyGosling agrees
    • BaronVonDoppleG agrees
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Posts
    17
    Rep Power
    0
    As I can see - you forgot to write a dot in your Sub:

    Private Sub GenToggle(layername,chkname)
    Dim myMap
    Set myMap = getMap()
    If chkname.checked = True then
    myMap.getMapLayer(layername).setVisibility(1)
    myMap.refresh()
    Else
    myMap.getMapLayer(layername).setVisibility(0)
    myMap.refresh()
    End If
    End Sub
    May be it will help you?

    Good Luck!
    __________________________
    With best regards,
    Julia Pavlova
    Programmer
    Rapid Internet Development
    AlarIT Inc.
    URL: http://www.alarit.com

    Comments on this post

    • JimmyGosling agrees
    • BaronVonDoppleG agrees

IMN logo majestic logo threadwatch logo seochat tools logo