VB6 - 定义一个字符串数组 [英] VB6 - Defining a String Array

查看:40
本文介绍了VB6 - 定义一个字符串数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用 VB6,但我正在努力完成一些基本任务.

I need to use VB6 and I'm struggling with a few basic tasks.

例如当我在 C# 中定义一个数组时:

When I define an array in C# for example:

string[] s = {"a", "b", "c", "d" };

但在 VB6 中,我一直在这样做:

But in VB6, I've been doing this:

Dim s(0 To 3) As String
s(0) = "a"
s(1) = "b"
s(2) = "c"
s(3) = "d"

在 VB6 中定义数组是否有比我上面说明的示例更有效的方法?类似于 C# 的方式?

Is there a more efficient way of defining an array in VB6 than the example I illustrated above? A way similar to the C# approach?

推荐答案

Dim s
s = Array("a", "b", "c", "d")

这篇关于VB6 - 定义一个字符串数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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