一个VBScript函数可以返回一个字典? [英] Can a VBScript function return a dictionary?

查看:113
本文介绍了一个VBScript函数可以返回一个字典?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有表单数据的字典,我想用一个函数来修改。

I have a dictionary of form data that I want to modify using a function.

function queryCleanForm(myDictForm)

    dim arrayKeys
    arrayKeys = myDictForm.keys

    for i=0 to myDictForm.count-1
        myDictForm(arrayKeys(i)) = replace(myDictForm(arrayKeys(i)), "'", "''")
        response.write myDictForm(arrayKeys(i))
    next

    queryCleanForm = myDictForm
end function

问题是行 queryCleanForm = myDictForm 错误,因为

Wrong number of arguments or invalid property assignment 

有没有办法在VBScript中做到这一点?

Is there a way to do this in VBScript?

推荐答案

试试这个:

SET queryCleanForm = myDictForm

使用的对象,您需要使用SET告诉VBScript中,这是你要分配不是值类型的对象引用。

With objects you need to use SET to tell VBScript that it is an object reference you are assigning not a value type.

这篇关于一个VBScript函数可以返回一个字典?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆