Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Mon May 05, 2008 5:38 am Post subject: HOWTO: Use ByRef event parameters in VBScript in an HTML/ASP page |
|
|
VBScript does not support ByRef parameters, so those events which use ByRef parameters to pass back information to FolderView do not work. Thus, the following VBScript code to do custom sorting does not work :
<SCRIPT language="VBScript">
Sub FolderView1_OnOleStartDrag(Data,Node,effects,button,Cancel)
' 1 = DROPEFFECT_COPY (Only Copy operation allowed)
effects = 1
end sub
</SCRIPT>
Instead of using the ByRef parameter, the information should be passed to FolderView using the SelectNode method as follows :
<SCRIPT language="VBScript">
Sub FolderView1_OnOleStartDrag(Data,Node,effects,button,Cancel)
' 1 = DROPEFFECT_COPY (Only Copy operation allowed)
value = "intprop:" +cstr(1)
folderView1.SelectNode(value,0,0)
end sub
</SCRIPT>
Use the prefix "intprop:" for ByRef parameters of type 'integer' or 'long'; use "strprop:" for ByRef parameters of type 'string' (used in OnInitialize and OnGetInfoTip). Note that the prefix ("intprop:" or "strprop:") must be lowercase. |
|