dcsimg
Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Oct 24, 2001

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


A VB Code Generator


Sometimes you want to initialize arrays with values, but you can't because you'd have to provide values explicitly. There is a way to generate these kinds of assignment statements.

Say you need to initialize 100 array elements:
 
a(1)="c",a(2)="vb".......a(100)="c#"

It's very tedious to write "a(1)...a(100)" manually, but you can write a program to generate the code like this:
 
For I=1 to 100
  Debug.Print "a(" & I & ")="""""
Next

after executing the above we will the strings like the following:

a(1)=""
a(2)=""
Prasad Haridass
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date