vb5 Passing an array of type MENU to a Sub 
Author Message
 vb5 Passing an array of type MENU to a Sub

can the body of this code be generalised into a routine?
Its not as simple as it first appears.

m_xxx(index as integer)

    dim i as integer

    for i = 0 to m_xxx.ubound    'CLEAR ALL CHECKS
        m_xxx(i).checked = False
    next

   m_xxx(index).checked = True   'CHECK THE NEW SELECTION
end sub

is m_xxx() an array of controls or a control-array? or an array of
a predefined type or class?

can I pass it as a parameter



Wed, 18 Jun 1902 08:00:00 GMT  
 vb5 Passing an array of type MENU to a Sub
R Seabrook,

Pass the control array as 'Object'; pass on/off switches as a paramarray.
The sub could be:

Sub Setmenu(Menus As Object, paramarray Vals() as variant) {
    Dim i as integer
    for i=0 to ubound(vals)
        menus(i).checked = (vals(i)=true)
    next

Quote:
}

And calling it would be like:

Setmenu mnuTools, true, true, false, false...

--A



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. menus and sub-menus and sub-sub-menus

2. VB5 passing arguements, user defined types and arrays

3. vb5 Customize Toolbars/menus -- can you define sub-menus

4. How to pass an integer array/userdef type array into an Oracle Stored procedure

5. Passing UserDefined type vars into a forms sub (VB4.0)

6. Type mismatch passing argument to sub

7. Problems passing DATE type parameter to sub report

8. pass an array as function/sub argument

9. Question on passing array parameters to VB.NET Sub/Function

10. Problem in passing datarow array from one sub to other

11. Passing Arrays from Sub to Program

12. Help! Problem passing string array to sub

 

 
Powered by phpBB® Forum Software