Is there ways to create optional arguments to functions in vbscript?

后端 未结 5 1291
名媛妹妹
名媛妹妹 2020-12-17 08:14

Is there ways to create optional arguments to functions in vb script allowing you to write functions something like...

myFunc(\"happy\")
myFunc(\"happy\", 1,         


        
5条回答
  •  孤街浪徒
    2020-12-17 09:00

    Obviosly this depends on your environment and whether it supports using both JScript and VBScript in the same file, but I've had some success using Windows Script Host (*.wsf files), ie

    
    
        
        
    
            
            
        
    
    

    where you can define your function in JScript and reference it in VBScript. A better way may well be to include your JScript functions as an external file ie

        
    

提交回复
热议问题