Computer Security & Viruses/visual basic

Advertisement


Question
QUESTION: which one of following statements declares a fixed-length string variable named strName that can contain a maximum of 20 characters?
Dim strName as String & 20
Dim strName as String *20
Dim strName *20 as String
Dim strName {20} as String

thanks

ANSWER: I am almost certain it would be: Dim strName {20} as String

The way it was taught to me is the number in parentheses is "elements" instead of "characters".

Keith

---------- FOLLOW-UP ----------

QUESTION: please help with this issue;
If you invoke the Update Age procedure,passing it a String variable named strfriend and an integer variable named intAge, which one of the following is a correct Private Sub statement for the UpdateAge procedure?
Private Sub UpdateAge {intAge as Integer,strMyFriend as String}
Private Sub {updateAge}strFriend as string,intAge as Integer
Private Sub UpdateAge intAge as Integer,strfriendName as string
Private sub UpdateAge {strfriendName as String,intAge as Integer}


Answer
I'm not sure any of these is correct. I think the commands would be broken down into shorter statements. I'm in no way an expert on computer programming. I just have taken a few classes in getting my CS degree. I used Visual Studio 2008 in my last class. I'm sorry I couldn't be of more help. You should submit your question to http://www.tech-forums.net/ . I believe they have an entire section on programming.

Keith

Computer Security & Viruses

All Answers


Answers by Expert:


Ask Experts

Volunteer


Keith Davis

Expertise

Advice on how to avoid viruses and spyware. Suggestions on what software to run to avoid viruses and spyware. Identification of spyware, trojans, or virus infections. Overall system security.

Experience

As a PC tech, removing and identifying many viruses and trojans from customer's PCs.

Education/Credentials
4 classes short of a Networking degree.

©2012 About.com, a part of The New York Times Company. All rights reserved.