使用Powerbuilder中数据窗口表达式访问数据
2005-08-27 15:58
423 查看
1、从数组到数据窗口到数组
This example resets the emp_name value in rows 11 through 20 to an empty string. Rows 12 to 20 are set to a default value, which may be an empty string:
string ls_empty[]
ls_empty[1] = ""
dw_1.Object.emp_name[11,20] = &
{"","","","","","","","","",""}
This statement gets the original emp_name values in rows 11 to 20 and assigns them to elements 1 to 10 in an array of strings:
string ls_namearray[]
ls_namearray = dw_1.Object.emp_name.Original[11,20]
2、从数据窗口将数据拷贝到另一数据窗口
This example replaces all the data in the nested report in row 2 with data from dw_2. The columns in the DataWindow object in dw_2 must match the columns in the DataWindow object for the nested report:
dw_1.Object.NestRep[2].Object.Data = &
dw_2.Object.Data
3、将删除缓冲区中的数据放到到文件中
This example gets employee IDs and last names for all the rows in the delete buffer. The IDs and names are the first two columns. It saves the information in a structure, called str_namelist, of two elements: an integer called id and a string called lastname. The structure was defined previously in the Structure painter. The list of IDs and names is then saved in the file DELETED.TXT:
integer li_fileNum
long ll_deletedrows
str_namelist lstr_namelist[]
ll_deletedrows = dw_1.DeletedCount()
lstr_namelist = &
dw_1.Object.Data.Delete[1,1, ll_deletedrows,2]
li_fileNum = FileOpen("C:/HR/DELETED.TXT", &
LineMode!, Write!)
FOR ll_count = 1 to UpperBound(lstr_namelist)
FileWrite(li_fileNum, &
String(lstr_namelist.id) + &
" " + &
lstr_namelist.lastname + &
"~r~n")
NEXT
FileClose(li_fileNum)
This example resets the emp_name value in rows 11 through 20 to an empty string. Rows 12 to 20 are set to a default value, which may be an empty string:
string ls_empty[]
ls_empty[1] = ""
dw_1.Object.emp_name[11,20] = &
{"","","","","","","","","",""}
This statement gets the original emp_name values in rows 11 to 20 and assigns them to elements 1 to 10 in an array of strings:
string ls_namearray[]
ls_namearray = dw_1.Object.emp_name.Original[11,20]
2、从数据窗口将数据拷贝到另一数据窗口
This example replaces all the data in the nested report in row 2 with data from dw_2. The columns in the DataWindow object in dw_2 must match the columns in the DataWindow object for the nested report:
dw_1.Object.NestRep[2].Object.Data = &
dw_2.Object.Data
3、将删除缓冲区中的数据放到到文件中
This example gets employee IDs and last names for all the rows in the delete buffer. The IDs and names are the first two columns. It saves the information in a structure, called str_namelist, of two elements: an integer called id and a string called lastname. The structure was defined previously in the Structure painter. The list of IDs and names is then saved in the file DELETED.TXT:
integer li_fileNum
long ll_deletedrows
str_namelist lstr_namelist[]
ll_deletedrows = dw_1.DeletedCount()
lstr_namelist = &
dw_1.Object.Data.Delete[1,1, ll_deletedrows,2]
li_fileNum = FileOpen("C:/HR/DELETED.TXT", &
LineMode!, Write!)
FOR ll_count = 1 to UpperBound(lstr_namelist)
FileWrite(li_fileNum, &
String(lstr_namelist.id) + &
" " + &
lstr_namelist.lastname + &
"~r~n")
NEXT
FileClose(li_fileNum)
相关文章推荐
- 在DELPHI中使用ADO直接访问Excel数据文件
- powerbuilder 中使用flash,flash无法根据窗口的大小自动调整
- Spring Boot(7)— Spring Boot中使用Spring-data-jpa让数据访问更简单、更优雅
- 使用vue-cli脚手架 与 axios 请求数据 配置代理进行跨域访问数据问题
- 使用C语言访问MySQL数据 —— 连接和错误处理
- 使用jdbc的方式访问kylin cube的数据
- 使用javascript和正则表达式进行数据验证
- 使用JDBC进行数据访问【spring-framework-reference】
- 提高C#编程水平的50个要点 1.总是用属性 (Property) 来代替可访问的数据成员 2.在 readonly 和 const 之间,优先使用 readonly 3.在 as 和 强制类型转换之
- Delphi环境下使用定制接口开发OPC数据访问客户程序
- 在PowerScript脚本中访问数据窗口中的数据
- Android之 内容提供器(1)——使用内容提供器访问其它程序共享的数据
- 在WCF数据访问中使用缓存提高Winform字段中文显示速度
- 使用SQL Server Management Studio访问阿里云RDS SQL Server数据
- 访问额外窗口数据的函数
- python使用点操作符访问字典(dict)数据
- 【Java并发编程实战】– 使用读写锁实现同步数据访问 lock_2
- 使用OAuth2.0授权访问新浪微博数据
- 使用C# lock同时访问共享数据
- iphone 使用委托(delegate)在不同的窗口之间传递数据