To know the length of a structure.

Posted on 2011-03-17
Last Modified: 2013-12-26
pb 10.5

If a structure contains 5 items then the length of the structure is 5.

What is the command to find the length of a structure?
Question by:Mehram
  • 2
  • 2

Expert Comment

ID: 35164355
I don't fully understand the question.  Can you post an example structure definition along with what you would expect the 'length' to be?

Author Comment

ID: 35165358
Take this strucure

global type str_menu from structure
      distr_acc_menu            m_distr_acc_menu
      distr_menu            m_distr_menu
      distr_setup_menu            m_distr_setup_menu
      distr_pur_sales_menu            m_distr_pur_sales_menu
end type

there are 4 menu items in this structure, hence the length is 4.

I want to know the length via script

Accepted Solution

lbushby earned 500 total points
ID: 35165715
OK, I think you can do this using the ClassDefinition property e.g.

str_menu      lstr_structure
ClassDefinition                        ldc_classdefinition
VariableDefinition                  lvd_variabledefinition[]
integer                                          li_length

ldc_classdefinition = lstr_structure.ClassDefinition

lvd_variabledefinition[] = ldc_classdefinition.VariableList[]

li_length = UpperBound(lvd_variabledefinition[]) - 1

Author Closing Comment

ID: 35165806
Just like that!!!!

I love u!!!!

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What is an NDK ? 3 103
regex. How to include lines between 10 89
JavaFX TableView not displaying correctly 3 60
Export all vba modules from outlook vbaproject.otm 7 32
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question