Home > ASP Programming > Proper syntax for Sub?

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

    
Guest


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


Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2010 by Infoqu. All rights reserved