最新更新 sitemap 网站制作设计本站搜索
网页设计
国外网站 韩国网站 个人主页 手提袋设计 CSS 网页特效 平面设计 网站设计 Flash CMS技巧 服装网站 php教程 photoshop 画册 服务器选用 数据库 Office
虚拟主机 域名注册 云主机 网页设计 客服QQ:8208442
当前位置:首页 > 编程开发 > asp教程

ASP将两个数组合并为一个数组函数 array_merge()

日期:04-23    来源:中国设计秀    作者:cnwebshow.com

<%B5L中国设计秀
    ' Copyright (c) 2009, reusablecode.blogspot.com; some rights reserved.B5L中国设计秀
    'B5L中国设计秀
    ' This work is licensed under the Creative Commons Attribution License. To viewB5L中国设计秀
    ' a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ orB5L中国设计秀
    ' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, CaliforniaB5L中国设计秀
    ' 94305, USA.B5L中国设计秀

    ' Merge two arrays into one.B5L中国设计秀
    function array_merge(byVal firstArray, byVal secondArray)B5L中国设计秀
        dim totalSizeB5L中国设计秀
        dim iB5L中国设计秀
        dim combinedArrayB5L中国设计秀
        B5L中国设计秀
        ' Ensure that we're dealing with arrays.B5L中国设计秀
        if not isArray(firstArray) thenB5L中国设计秀
            firstArray = Array(firstArray)B5L中国设计秀
        end ifB5L中国设计秀
        B5L中国设计秀
        if not isArray(secondArray) thenB5L中国设计秀
            secondArray = Array(secondArray)B5L中国设计秀
        end ifB5L中国设计秀
        B5L中国设计秀
        ' Set up the new array.B5L中国设计秀
        totalSize = uBound(firstArray) + uBound(secondArray) + 1B5L中国设计秀
        combinedArray = firstArrayB5L中国设计秀
        redim PReserve combinedArray(totalSize)B5L中国设计秀
        B5L中国设计秀
        for i = 0 to uBound(secondArray)B5L中国设计秀
            combinedArray(uBound(firstArray) + 1 + i) = secondArray(i)B5L中国设计秀
        nextB5L中国设计秀
        B5L中国设计秀
        array_merge = combinedArrayB5L中国设计秀
    end functionB5L中国设计秀
%>B5L中国设计秀

本文引用地址:/bc/article_46284.html
网站地图 | 关于我们 | 联系我们 | 网站建设 | 广告服务 | 版权声明 | 免责声明