this
run ok ( with your funcs)
#include "FiveWin.ch"
function Main()
local oWnd
DEFINE WINDOW oWnd MENU BuildMenu()
ACTIVATE WINDOW oWnd
return nil
//---------------------------------------------------------------------------------------------------------//
function BuildMenu()
local oMenu,nhh,baction
MENU oMenu
MENUITEM "First"
MENU
For nhh= 1 to 4
baction:= GenBlock_Faiz(nhh)
MENUITEM "function number "+ltrim(str(nhh)) BLOCK baction
next
ENDMENU
ENDMENU
return oMenu
//---------------------------------------------------------------------------------------------------------//
FUNCTION GenBlock_Faiz(nhh)
LOCAL cProc := "Faiz"+ALLTRIM(STR(nhh))
RETURN {|| &(cProc)() }
//---------------------------------------------------------------------------------------------------------//
Function Faiz4()
return Msginfo("run 4")
Function Faiz3()
return Msginfo("run 3")
Function Faiz2()
return Msginfo("run 2")
Function Faiz1()
return Msginfo("run 1")
On the other hand, if you want to make a popup menu on a window
then it just doesn't work
#include "FiveWin.ch"
function Main()
local oWnd
DEFINE WINDOW oWnd MENU BuildMenu()
ACTIVATE WINDOW oWnd ;
ON CLICK ShowPopup( nRow, nCol,oWnd )
return nil
function ShowPopup( nRow, nCol,oWnd)
local oPop
MENU oPop POPUP
MENUITEM "Menu popup "
MENU
For nhh= 1 to 4
baction:= GenBlock_Faiz(nhh)
MENUITEM "function number "+ltrim(str(nhh)) BLOCK baction
next
ENDMENU
ENDMENU
ACTIVATE POPUP oPop AT nRow, nCol OF oWnd
return nil
//---------------------------------------------------------------------------------------------------------//
FUNCTION GenBlock_Faiz(nhh)
LOCAL cProc := "Faiz"+ALLTRIM(STR(nhh))
RETURN {|| &(cProc)() }
//---------------------------------------------------------------------------------------------------------//
Function Faiz4()
return Msginfo("run 4")
Function Faiz3()
return Msginfo("run 3")
Function Faiz2()
return Msginfo("run 2")
Function Faiz1()
return Msginfo("run 1")
I would also be interested in solving the problem. thank you
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com