以下是引用TonyDeng在2012-9-18 22:43:57的发言:
出现大量重复代码了!
出现大量重复代码了!
那怎么办 我也考虑过这个情况 但是 一个命令按钮组里的单独按钮的caption ,left, top ,forecolor 都是不一样的啊
梅尚程荀
马谭杨奚
procedure Arrange parameters btn_name, btn_top, btn_left, btn_caption, btn_forecolor with this.btn_name .Themes = .F. .Height = 27 .Width = 35 .Top = btn_top .Left = btn_left .Caption = btn_caption .ForeColor = btn_forecolor endproc会提示没有btn_name这个东西?
procedure Arrange parameters btn_top, btn_left, btn_caption, btn_forecolor .Themes = .F. .Height = 27 .Width = 35 .Top = btn_top .Left = btn_left .Caption = btn_caption .ForeColor = btn_forecolor endproc procedure init local sp as Integer sp = 4 store Rgb(255, 0, 0) to R store Rgb(0, 0, 255) to B with (0, 0, '7', Rgb(0, 0, 255)) endwith with (Top, Left + + sp, '8', B) endwith with (Top, Left + + sp, '9', B) endwith with (Top, Left + + sp, '/', R) endwith with (Top, Left + + sp, 'sqrt', B) endwith with (Top + + sp, Left, '4', B) endwith with (Top, Left + + sp, '5', B) endwith with (Top, Left + + sp, '6', B) endwith with (Top, Left + + sp, '/', R) endwith with (Top, Left + + sp, '%', B) endwith endproc算了 偷看代码去 貌似瞄到一眼 给按钮赋值很简洁 忍不住了啊