谢谢大家的支持!
我对Delphi不熟,但题中的模式是我想把我以前在VFP中开发的一个系统移植到Delphi的,因为在VFP中有一个宏替换,所以我以表格代替菜单,并以此控制权限。如题中的事我是这样解决的:
......
MyPro='Do Form '+formnm+'.scx'
&MyPro
......
但Delphi中没有“宏”这一东东,所以我卡住了,因为全用菜单的话,将会有一堆如下的命令:
......
if MyPermission[2]<>'Y' then N23.Enabled:=false;
if MyPermission[3]<>'Y' then N24.Enabled:=false;
if MyPermission[4]<>'Y' then N25.Enabled:=false;
if MyPermission[5]<>'Y' then N26.Enabled:=false;
if MyPermission[6]<>'Y' then N13.Enabled:=false;
if MyPermission[7]<>'Y' then N14.Enabled:=false;
.......
如果我有一、二百项或更多,这写起来不是太容易搞错了吗?
还请高手赐招!