解决使用变量打开窗口,使用窗口名不能引用的问题.
2006-10-20 11:17
676 查看
例如
window w_open
open( w_open,'w_test')
语句执行后,生成一个窗口对象w_open,而不是w_test.所以不能以w_test引用
解决方法:
1.定义全局变量 window gw_openwindow[] //定义窗口数组,保存打开的窗口
string gs_windowname //类名 w_test
2.定义全局函数
none function gf_savewindow(rw_window,vs_windowname)
返回值 无
参数 rw_window 当前打开的窗口 引用
vs_windowname 打开窗口的类名 传值
int i,n
n=upperbound(gw_openwindow)
for i=1 to n
if gs_windowname[i]=vs_windowname then
gw_openwindow[i]=rw_window
return
end if
next
gw_openwindow[i]=rw_window
gs_windowname[i]=vs_windowname
int function gf_getwindow(vs_windowname)
int i,n
n=upperbound(gw_openwindow)
for i=1 to n
if gs_windowname[i]=vs_windowname and isvalid(gw_openwindow[i]) then return i
next
return -1 //窗口不存在,调用它的函数必须检查返回值,不必判断有效性
3.使用
打开时 window w_open
open( w_open,'w_test')
gf_savewindow(w_open,'w_test') //保存打开的窗口
引用时 int n
n=gf_getwindow('w_test')
if n<>-1 then
gw_openwindow
.其它属性或函数或事件
end if
window w_open
open( w_open,'w_test')
语句执行后,生成一个窗口对象w_open,而不是w_test.所以不能以w_test引用
解决方法:
1.定义全局变量 window gw_openwindow[] //定义窗口数组,保存打开的窗口
string gs_windowname //类名 w_test
2.定义全局函数
none function gf_savewindow(rw_window,vs_windowname)
返回值 无
参数 rw_window 当前打开的窗口 引用
vs_windowname 打开窗口的类名 传值
int i,n
n=upperbound(gw_openwindow)
for i=1 to n
if gs_windowname[i]=vs_windowname then
gw_openwindow[i]=rw_window
return
end if
next
gw_openwindow[i]=rw_window
gs_windowname[i]=vs_windowname
int function gf_getwindow(vs_windowname)
int i,n
n=upperbound(gw_openwindow)
for i=1 to n
if gs_windowname[i]=vs_windowname and isvalid(gw_openwindow[i]) then return i
next
return -1 //窗口不存在,调用它的函数必须检查返回值,不必判断有效性
3.使用
打开时 window w_open
open( w_open,'w_test')
gf_savewindow(w_open,'w_test') //保存打开的窗口
引用时 int n
n=gf_getwindow('w_test')
if n<>-1 then
gw_openwindow
.其它属性或函数或事件
end if
相关文章推荐
- 不能使用文本编码“简体中文(Mac OS)”来打开文件“**.txt”问题的解决(转)
- 使用PCI-E USB3.0扩展板卡解决OPENCV不能同时打开同品牌摄像头的问题
- 遇到Word2007 只能打开一个文档,切换窗口再回去鼠标也不能用。解决问题
- 关于AIX下的su不能使用环境变量问题的解决
- 打开新窗口的window.open使用方法以及最大化等问题解决方法汇总
- 解决IE不能打开新窗口的问题
- 解决win8使用内置管理员不能打开应用商城、天气等问题
- 【ZYNQ LINUX】使用问题04 ubuntu12 环境变量修改错误,不能进入root 修改的解决办法
- 4:上网时只能打开一个IE窗口..不能打开第二个..怎样解决这个问题?
- 在使用SSIS设计脚本时候,出现的在PostExecute之外不能锁定变量集合进行读写访问的问题的解决
- WPF WebBrowser 使用window.open()打开 新窗口相关问题的解决
- 打开新窗口的window.open使用方法以及最大化等问题解决方法汇总
- 【转载】IE中Iframe跨站引用时,框架内程序不能使用cookies问题解决
- JSP使用base标签和时间控件时IE6下不能打开站点,已终止操作问题解决
- 解决ebs不能打开forms窗口的问题
- 打开新窗口的window.open使用方法以及最大化等问题解决方法汇总
- ADAMS使用过程中的license不可用导致软件不能打开问题的解决
- 此虚拟机似乎正在使用中,虚拟机不能打开问题解决
- 解决sqlplus中输错命令时的删除、光标键不能使用问题
- 解决ubuntu中vi不能正常使用方向键与退格键的问题