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
			
			
									
									
						DCMENUITEM
- 
				Wolfgang Ciriack
- Posts: 494
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: DCMENUITEM
NIL is returned for o:cargo[3]
			
			
									
									
						Re: DCMENUITEM
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 :
			
			
									
									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.
						
