Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

vb6 for each command

Original Message
Name: wille
Date: January 2, 2008 at 01:17:32 Pacific
Subject: vb6 for each command
OS: WINDOWS XP Home Edition
CPU/Ram: 3.2GHz
Comment:
Hi!
In vb6 I use the command:
For Each Line In Text1.Text
but this doesn't work, any suggestions?

so sick of vb, never works as supposed to

/thanks in advance


Live The Life As You Know It


Report Offensive Message For Removal


Response Number 1
Name: klint
Date: January 2, 2008 at 04:18:50 Pacific
Subject: vb6 for each command
Reply: (edit)
It sounds like you haven't read the manual properly. Why do you think it never works as it's supposed to? Why do you think you can iterate over a string? The For Each command only iterates over collections and arrays. The Text property is just a String.

Report Offensive Follow Up For Removal

Response Number 2
Name: wille
Date: January 2, 2008 at 06:29:42 Pacific
Subject: vb6 for each command
Reply: (edit)
ok thanks I did'nt understand a crap of that, n I dun have a manual

Live The Life As You Know It


Report Offensive Follow Up For Removal

Response Number 3
Name: klint
Date: January 2, 2008 at 06:48:08 Pacific
Subject: vb6 for each command
Reply: (edit)
Let me try again. Text1.Text is a single string, so you can just print it out like a string variable. If your text box is multi-line, the string is still a single string but it contains carriage return characters (chr(13)) to delimit each line. As for a manual, you don't actually need one, as the F1 Help facility contains much useful information to get you going. However, if you have come from an old, procedural type of Basic language (such as the ones you used to get on the old DOS systems), you'll need to know a little bit about object-oriented programming in order to use VB effectively.

Report Offensive Follow Up For Removal

Response Number 4
Name: StuartS
Date: January 2, 2008 at 07:01:58 Pacific
Subject: vb6 for each command
Reply: (edit)
If you don understand what klint was trying to tell you then you need to go back to basics and learn the difference between strings, variables, collections and arrays. Fundamental stuff in any programming language.

There is only one Text1.text so for each is meaningless in this context. However if text1.text was part of an array, e.g text1(0)text, text1(1).text, etc, then it would work. If you learn nothing else, learn about arrays. Very powerful concepts when used properly

The entire VB6 documentation is available on-line - all you ever needed to know about VB6. All you have to do is read it.

http://msdn2.microsoft.com/en-us/li...

Stuart


Report Offensive Follow Up For Removal

Response Number 5
Name: RugZ
Date: January 16, 2008 at 05:15:30 Pacific
Subject: vb6 for each command
Reply: (edit)
In VB.Net, all variable types are derived from the object class. Therefore on "may" iterate using the For...Each loop. No. But then it doesent hurt to read the manual

You can argue, fight and quarrel all you want, but at the end of the day you will have a headache


Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: vb6 for each command

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




acer 312T BIOS problem

K7 Turbo possible max fsb?

Pc anywher problem

WinFLP & OE/Outlook2003

Computer resets after a few minutes


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC