DCMENUITEM

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

DCMENUITEM

#1 Post by unixkd »

Hi Roger

In the code below, the 3rd element, of the :CARGO which suppose to be "MyDataHere" is NIL.

DCMENUITEM "My menu here";
CARGO "MyDataHere" ;
ACTION {|a,b,o| DC_Arrayview({a, o:items[a], o, o:cargo })}

Thanks.

Joe

Wolfgang Ciriack
Posts: 479
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: DCMENUITEM

#2 Post by Wolfgang Ciriack »

Try o:cargo[3]
_______________________
Best Regards
Wolfgang

User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

Re: DCMENUITEM

#3 Post by unixkd »

NIL is returned for o:cargo[3]

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCMENUITEM

#4 Post by rdonnay »

Apparently this has never worked nor has it ever been tested.
I will need to remove the CARGO clause from the DCMENUITEM docs.

You can only apply CARGO to the DCSUBMENU object.
DCMENUITEM not not objects. They are indexed sub-items of the DCSUBMENU object.

Here is an example of way to use CARGO of DCSUBMENU to get what you want :

Code: Select all

 DCSUBMENU oMenuFile PROMPT 'File' PARENT oMenuBar ;
     CARGO {'Item 1 Cargo', ;
            'Item 2 Cargo', ;
            'Item 3 Cargo', ;
            'Item 4 Cargo', ;
            'Item 5 Cargo'}

    DCMENUITEM 'Data Tree Menu' PARENT oMenuFile ;
      ACTION {||GuiRun({|a|::TreeWindow()})} ;
      WHEN {||::oTree == nil}

    DCMENUITEM 'Create New Connection' PARENT oMenuFile ;
      ACTION {|a,b,o|(wtf DC_GetCargo(o)[2]), ::CreateNewConnection()} 

    DCMENUITEM 'Disconnect all Connections' PARENT oMenuFile ;
      ACTION {|a,b,o|(wtf DC_GetCargo(o)[3]), ::DisconnectConnections()}

    DCMENUITEM 'Restart SqlQuery.Exe' PARENT oMenuFile ;
      ACTION {||RunShell('',AppName(.t.),.t.,.t.),Sleep(10),_quit()}

    DCMENUITEM 'Edit SqlQuery.Ini File' PARENT oMenuFile ;
      ACTION {||RunShell('SqlQuery.ini','Notepad.exe')}

    DCMENUITEM 'Browse SqlQuery.Dbf (Dictionary) File' PARENT oMenuFile ;
      ACTION {||::BrowseSqlQueryDbf()}
The eXpress train is coming - and it has more cars.

Post Reply