Solved

To know the length of a structure.

Posted on 2011-03-17
4
303 Views
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?
0
Comment
Question by:Mehram
  • 2
  • 2
4 Comments
 
LVL 2

Expert Comment

by:lbushby
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?
0
 

Author Comment

by:Mehram
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
0
 
LVL 2

Accepted Solution

by:
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
0
 

Author Closing Comment

by:Mehram
ID: 35165806
Just like that!!!!


I love u!!!!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

912 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now