Save
Forgot Password
Register Here
Resources
Applications
AI
Business
Components and Libraries
Computer Science
Database
Documents And Specifications
Enterprise Application Integration
Game
Hardware
Multimedia
Network
Security
Tools And Utilities
Training And Certification
Web
Languages
Assembly
Basic
C
C#
C++
Delphi
Java
JavaScript
Other Languages
Pascal
Perl
PHP
Python
Ruby
VB-Script
Visual Basic
Platforms
.NET
Browser Based
Consoles
CPU
Embedded
Java Platform
Legacy Platforms
Linux
Macintosh
Mobile Platforms
MS-DOS
Remotely Hosted
UNIX
WEB Service
Windows
Forums
Unanswered Posts
Latest Threads
Latest Posts
Programming Languages
Assembler Developer
Basic
C and C++
C#
Delphi and Kylix
Java
Pascal
Perl
PHP
Python
Ruby
VB.NET
VBA
Visual Basic
Applications
Computer Graphics
Computer Hardware
Database & SQL
Electronics development
Game programming
Matlab
Sound & Music
XML Development
Classifieds
Co-operative Projects
For sale
FreeLance Software City
Jobs Available
Jobs Wanted
Wanted
Microsoft .NET
.NET General
ASP.NET
Miscellaneous
Comments on the PH Re-design
Comments on this site
Computer Emulators
General programming
New programming languages
Off topic board
Mobile & Wireless
Palm Pilot
Multimedia
Demo programming
MP3 programming
Operating Systems & Platforms
Cloud Computing
Embedded / RTOS
FreeBSD
LINUX programming
MS-DOS
Windows CE & Pocket PC
Windows programming
Software Development
Algorithms
Object Orientation
Project Management
Quality & Testing
Security
WEB-Development
Active Server Pages
AJAX
CGI Development
ColdFusion
Flash development
HTML & WEB-Design
Internet Development
JavaScript
WEB Servers
WEB-Services / SOAP
Blogs
Blog Startpage
Latest Blog Posts
Submit
Article
Book
File
Link
News
PAD File
Wiki Article
Jobs
Dev Tools
PH
Search
Newsletter
Merchandise
Top User Lists
Getting Started Guide
Help
Advertise
Contact Us
HOME
>
Forums
>
Visual Basic
> Clearing an array?
Visual Basic
Moderators: None (
Apply to moderate this forum
)
Number of threads:
18011
Number of posts:
55384
With full replies
Topics only
Visual Basic
Subforums
Forum Info
This Forum Only
Single Post View
Linear View
Threaded View
f
Printer Friendly
RSS Feed
Clearing an array?
Posted by
CookieMonster
on 17 Apr 2011 at 5:47 AM
Would it be possible for someone to help explain how to clear an array of values currently stored in it. Would you go through the array line by line and write = "" or would you use to ReDim statement. Any help would be greatly appreciated.
Share By Email
Re: Clearing an array?
Posted by
pseudocoder
on 18 Apr 2011 at 8:51 PM
I'm not sure how later versions of VB handle it, but you might try the Erase function. If the array is static, the function will clear the value of each element; if the array is dynamic, it will destroy the elements.
Share By Email
Re: Clearing an array?
Posted by
JTB600A
on 2 May 2011 at 12:54 PM
ReDim
array(X)
with X being the size of your array - 1 (Programming Languages start at 0 not 1)
or
use a for...Next Loop
For
X
as integer
= 0 to (Array().length - 1)
Array(X) =
Nothing
Next
ReDim Preserve
Array(X)
this will Keep all values and just resize the array. with X being the size of the new array - 1
Share By Email
Recent Jobs
Home
About PH
Privacy Statement
Hosted SubVersion
Hosted Bugtracker
Contact Us
Advertise Here
Official Programmer's Heaven Blogs
Web Hosting
|
Browser and Social Games
|
Gadgets
Popular resources on Programmersheaven.com
Assembly
|
Basic
|
C
|
C#
|
C++
|
Delphi
|
Flash
|
Java
|
JavaScript
|
Pascal
|
Perl
|
PHP
|
Python
|
Ruby
|
Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our
Terms Of Use
and
Privacy Statement
for more information.
Operated by
CommunityHeaven
, a
BootstrapLabs
company.