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

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

问题描述

我在做一个项目,我需要使用VB6。
我有几个基本任务挣扎,部分原因是(我认为)是一个缺少文档,部分是因为我通常使用的语言有一个基于C的语法。

当我定义在C#中的数组,它通常如下:

 的String [] S = {A,B,C,D};

我想这样做在VB6。

但在VB6,都是我一直在做这样的:

 暗淡秒(0〜3)作为字符串
秒(0)=一个
秒(1)=b的
S(2)=C
秒(3)=d的

有没有在VB6中定义的数组比我上面的示例中的更有效的方法?类似于C#的做法的一种方式?


解决方案

 暗淡小号
S =阵列(一,B,C,D)

I'm doing a project, and I need to use VB6. I'm struggling with a few basic tasks, partially due to (what I think) is a lack of documentation, and partially because I usually use languages with a C based syntax.

When I define an array in C#, it usually follows:

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

I want to do this in VB6.

But in VB6, all I've been doing this:

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

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天全站免登陆