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


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

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