Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7787973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:50:36+00:00 2026-06-01T20:50:36+00:00

I am new to VB. I am reading some VB6 code and I come

  • 0

I am new to VB. I am reading some VB6 code and I come across declaration statements like

  PQR_SSN(8) As Byte // this probably refers to social security number
  TR_DATA(7) As TransactionDetail

In another file, TransactionDetial is defined

  Public Type TransactionDetail
  A(0) As Byte  
  B(0) As Byte
  Comment(40) As Byte
  //... etc
  //...
  End Type

Does TR_DATA(7) mean that it is an “array” that can store 8 instances of TransactionDetail?

Also, Consider Comment(40). Can I access individual bytes of the comment like this –

  Comment(3) 

Also, suppose that I do not assign all 41 bytes to Comment. Then will the rest of the bytes contain garbage values?

Please help. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:50:37+00:00Added an answer on June 1, 2026 at 8:50 pm

    Yes, TR_DATA(7) is an array of 8 elements of type TransactionDetail.

    Yes, the Comments array can be accessed through individual elements as you show.

    Unassigned elements may contain garbage values – I wouldn’t trust them – but I can’t recall whether VB helpfully pre-initialises variables. I would expect it would, just to be helpful to users, and that it would initialise numeric variables to 0, fixed-length strings to all zeros, and objects to Empty.

    Found this web link which gives some useful guidance on arrays in VB6.

    Also just found this: VB6 Variable Scope; which says:

    Unlike many other languages, VB does not allow you to initialize
    variables; this must be done with an executable statement. However,
    each variable does have a default initialization value. Numeric
    variable types are initialized to zero, Strings are initialized to “”,
    Booleans are initialized to False, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Python. While reading some code, I come across what is
I am currently reading some C++ source code, and I came across this: double
I was reading some Java recently and came across something (an idiom?) new to
I am new to vbscript and while reading i found some code as Do
I am new to Java. I'm a C++ programmer, reading some Java code. I
While reading some stuff on the pImpl idiom I found something like this: MyClass::MyClass()
I'm reading some XML with XmlReader using the following code: XmlReaderSettings settings = new
I am new to web development and WCF. I am reading some basics about
Brand new poster here on StackOverflow. I've been reading and learning here for some
This question arose while reading the new chapter in the excellent Learn You a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.