前往Shuct.Net首页

Shudepb PB反编译专家长时间以来,为业内同类软件事实上的唯一选择.细节,彰显专业.态度,决定品质.

关于PowerBuilder的搜索

关于PowerBuilder的全局函数重载问题 - chengg0769 来自四川,在东莞虚度十载 - 博客频道 - CSDN.NET chengg0769 来自四川,在东莞虚度十载 PB反编译_PowerBuilder DeCompiler_PB反编译器_PB混淆器_PB加密 目录视图 摘要视图 订阅 新年新气象------CSDN2014新版导航就要跟大家见面了 2014年1月微软MVP当选名单揭晓! 消灭0回答,赢下载分 “我的2013”年度征文活动火爆进行中! 专访何海涛:“不正经”程序员的进阶之路 关于PowerBuilder的全局函数重载问题 2010-04-28 01:37 879人阅读 评论(1) 收藏 举报 PowerBuildersubroutineintegerstringserver编译器 今天在调试反编译器,发掘几个网上下载的源码,是pb7写的程序,总是报错。最后ue打开仔细观察,发掘在一个func内赫然放着2个函数体。在最开始开发反编译器时,是从最简单的struct和func开始开发的,所以当初为struct和func单独写了函数,而且认定func内只有一个函数体。这就奇怪了。莫非是以前我想过的全局函数重载。。其实全局函数不能重载有时真的很烦人的。必须得写几个功能近似的。关键是函数名得另外取,不便于理解。其实我们知道,编译后是不需要函数名,只是一个查找和呼叫代号。 在网上搜一下,果然有篇2009的帖子给出了提示,也就是在source edit下可以手工增补而实现重载。编译器编译时会像c,c++编译器一样将函数按照不同的param列表来命名。并在联合编译器,在其他对象内引用时,给出具体的函数名。这其实是利用源码编辑直接绕过IDE的检测。我前段尝试在对象的create事件中手写代码来完成一些功能,貌似也是可以的。但是如果你一用画板,并修改了部分地方后保存的话,create中的代码就会被重新刷新。也就是它们都是由IDE直接控制的,如同其他编程语言的工程文件一样。 但是也发现一个问题,下面的帖子里是写成 global subroutine f_log (readonly string as_msg)global subroutine f_log (throwable at, readonly integer ai_nu)global subroutine f_log (readonly integer ai_nu) 但是从网上那个pbl中我看到重载的函数函数名不一样,有一个函数它内部的两个函数的参数表是不一致的,但是另外还有参数表相同的情况,搞不清楚到底是怎么回事。 因为我下载的是pb源码我打开pbl看到如下源码: //Here is Source in PBL or PBD,see it directly//Comments: global type f_addrecord from function_objectend type forward prototypesglobal subroutine uo_addrecord (datawindow dw, long row, string data)global subroutine f_addrecord (datawindow dw, long row, string data, datawindow dw_grid)end prototypes global subroutine uo_addrecord (datawindow dw, long row, string data); long ll_insertrow string ls_id datetime ldtm_server_time ls_id=dw.getitemstring(row,'id') /////////////////////////////////// ll_insertrow=dw.insertrow(0) dw.setitem(ll_insertrow,'id',data) dw.setitem(ll_insertrow,'state','0')//将状态设置为‘正常’ ldtm_server_time=f_get_server_time() dw.setitem(ll_insertrow,'create_date',ldtm_server_time) dw.setitem(ll_insertrow,'update_date',ldtm_server_time) dw.setitem(ll_insertrow,'create_by',gs_username) dw.setitem(ll_insertrow,'update_by',gs_username) //建档日期,修改日期均为服务器的当前日期 //建档人和修改人均为登录系统的用户名 dw.setitem(row,'id',ls_id) dw.scrolltorow(ll_insertrow) dw.setcolumn(2)end subroutine global subroutine f_addrecord (datawindow dw, long row, string data, datawindow dw_grid); long ll_insertrow string ls_id datetime ldtm_server_time //ls_id=dw.getitemstring(row,'id') /////////////////////////////////// ll_insertrow=dw.insertrow(0) dw.setitem(ll_insertrow,'id',data) dw.setitem(ll_insertrow,'state','0')//将状态设置为‘正常’ ldtm_server_time=f_get_server_time() dw.setitem(ll_insertrow,'create_date',ldtm_server_time) dw.setitem(ll_insertrow,'update_date',ldtm_server_time) dw.setitem(ll_insertrow,'create_by',gs_username) dw.setitem(ll_insertrow,'update_by',gs_username) dw.setitemstatus(ll_insertrow,0,primary!,notmodified!) //建档日期,修改日期均为服务器的当前日期 //建档人和修改人均为登录系统的用户名 //dw.setitem(row,'id',ls_id)// dw.scrolltorow(ll_insertrow) dw_grid.scrolltorow(ll_insertrow)// dw_grid.setfocus()// dw_grid.setcolumn(2)end subroutine 原来的确是在源码中就是写的两个不同的函数名。 实际上func虽然独立为一个对象,但是也可以理解为存放函数体的一个容器。正常情况,一个func对象内只有一个函数体,但是他跟uo,win一样都具备存放多个函数体的条件。只是IDE限制我们而已。 如果重载可以用,不过这种方法也太危险。因为画板会破坏手写的部分。还是建议用nvuo,符合类的概念。扩展也比较方便。 帖子http://topic.csdn.net/u/20090110/11/a9ab571b-535a-451e-a794-09c29178401b.html 全局函数重载原文:http://www.rgagnon.com/pbdetails/pb-0257.html Overload a global function thanks to Lawrence Sims for the following tip You can overload global function objects in PowerBuilder with a simple trick. Just always edit them in source view, not in the painter. The following function (f_log) can be called like so: f_log("Message To Be Logged") f_log(t_throwable_caught, populateError (0, "")) f_log(populateError(0, "Got to here ...")) [f_log.srf]just imported this file into a PBL to be able to use the overloaded f_log function) global type f_log from function_object end type type prototypes subroutine OutputDebugString (string as_msg) library "kernel32.dll" & alias for "OutputDebugStringA" end prototypes forward prototypes global subroutine f_log (readonly string as_msg) global subroutine f_log (throwable at, readonly integer ai_nu) global subroutine f_log (readonly integer ai_nu) end prototypes global subroutine f_log (readonly string as_msg); OutputDebugString (as_msg) end subroutine global subroutine f_log (throwable at, readonly integer ai_nu); string ls_message ls_message = error.text if isNull (error.text) or error.text = "" & then ls_message = at.getMessage () OutputDebugString (error.object + "." + error.objectevent + & ": line " + string (error.line) + ": " + ls_message) end subroutine global subroutine f_log (readonly integer ai_nu); if isValid (error) then OutputDebugString (error.object + "." + error.objectevent + & ": line " + string (error.line) + ": " + error.text) end if end subroutine 更多 上一篇:PowerBuilder混淆,加密(PowerBuilder防止反编译,pb混淆器,PB加壳,支持5-12) obfuscator for PowerBuilder 下一篇:有关PowerBuilder的悲观论和乐观论(由郭贴引发的300多贴争辩想到的,也是很久就想秉明的一个观点) 查看评论 * 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场 核心技术类目 全部主题 Java VPN Android iOS ERP IE10 Eclipse CRM JavaScript Ubuntu NFC WAP jQuery 数据库 BI HTML5 Spring Apache Hadoop .NET API HTML SDK IIS Fedora XML LBS Unity Splashtop UML components Windows Mobile Rails QEMU KDE Cassandra CloudStack FTC coremail OPhone CouchBase 云计算 iOS6 Rackspace Web App SpringSide Maemo Compuware 大数据 aptech Perl Tornado Ruby Hibernate ThinkPHP Spark HBase Pure Solr Angular Cloud Foundry Redis Scala Django Bootstrap 个人资料 chengg0769 访问:515767次 积分:8552分 排名:第420名 原创:267篇 转载:211篇 译文:0篇 评论:348条 文章搜索 文章分类 PB反编译与加密(12) IOS和安卓(9) PB与数据库(9) 网络相关(1) 搜索相关(0) 闲话扯起耍(1) 其他语言(4) 文章存档 2013年12月(2)2013年11月(2)2013年09月(1)2013年02月(1)2012年11月(1)2012年09月(1)2012年08月(6)2012年07月(1)2012年05月(3)2012年03月(4)2011年12月(2)2011年11月(2)2011年10月(9)2011年09月(6)2011年08月(11)2011年07月(2)2011年06月(4)2011年04月(3)2010年12月(1)2010年10月(2)2010年09月(8)2010年08月(1)2010年07月(8)2010年06月(17)2010年05月(2)2010年04月(2)2010年03月(4)2010年01月(1)2009年09月(8)2009年08月(5)2009年07月(8)2009年06月(8)2009年05月(16)2009年03月(2)2009年02月(7)2008年12月(2)2008年11月(4)2008年10月(5)2008年08月(1)2008年07月(2)2008年01月(12)2007年12月(29)2007年11月(7)2007年10月(4)2007年09月(20)2007年08月(55)2007年07月(176) 阅读排行 搜索引擎学习资源(作者:dongdonglang)(14656) 做代理网站最有效的4种宣传方法(admin9.com)(12007) 再谈PowerBuilder程序防止破解的办法(终结篇,以后不再写这个问题)(8066) 程序员的SEO总结(7459) 浅谈PowerBuilder的未来和PowerBuilder使用者的未来(5999) 在一台联想3000G430 T1600笔记本上安装黑苹果(东皇v10.6.3)成功(5948) PowerBuilder DeCompiler(PB DeCompiler) Demo download(PB反编译,支持5-12)(5887) PB11.5,PB12 web项目初探(5635) 文件夹加密原理 [转](5627) PowerBuilder反编译器开发-第一步:pbd结构分析和pbkiller分析(5473) 评论排行 浅谈PowerBuilder的未来和PowerBuilder使用者的未来(49) 程序员的SEO总结(32) 有关PowerBuilder的悲观论和乐观论(由郭贴引发的300多贴争辩想到的,也是很久就想秉明的一个观点)(22) PowerBuilder混淆,加密(PowerBuilder防止反编译,pb混淆器,PB加壳,支持5-12) obfuscator for PowerBuilder(20) 戏说DataWindow的“移植”和“临摹”(19) 因为垄断形成,数据库市场将出现更多开源数据库(19) 免费软件模式之随想(18) 软件提交到国外的下载站的几点操作和想法(15) PB11.5,PB12 web项目初探(15) 关于对pbd反编译器的期待(11) 推荐文章 最新评论 安装两个BCB6控件SynEdit、mwEdit 0.92a的过程总结 jiduxiaozhang12345: 请问BCB6的第三方控件在哪下载啊?急求 Powershield一个疑似的BUG zhj149: 高手啊,看你的文章,感觉你玩pb已经到了极致的境界了,我自认为pb还不错,和你比起来,还是差了太多了 软件提交到国外的下载站的几点操作和想法 u012353953: 楼主在吗?有个问题请教,看到请加我QQ,谢谢。17493589 Lucene(Nutch)距离商业文本搜索引擎还有多远?(转载) koubi1986: 你好!请教一些问题:请问一下1。你是如何把nutch抓取到的二进制内容,在项目中读取的。2。nutc... 看一个商业共享软件是如何在下载站刷下载量来作弊的! u011506701: 您的判断是有误的,像我研究的刷量算法你就根本看不出来,出现的曲线图跟正常的一模一样的,附:刷量是最好... 垂直搜索引擎蜘蛛的基本解决方案(编程实例:所以推荐) gis101989: 你好,我正在写面向主题搜索引擎结合地理信息的论文,很多地方不懂,能加个扣扣吗?非常感谢你的帮助,我的... 浅谈PowerBuilder的未来和PowerBuilder使用者的未来 hosthelp: PB的最大缺点就是:(其实很简单)过时了。 服装过时就没人穿了, 电器过时就没人买了, 明星过时(过... 三岁小孩开发搜索引擎,搜索引擎白热化[原创] rongzi1987: 顶一个。先顶再看 再谈PowerBuilder程序防止破解的办法(终结篇,以后不再写这个问题) hua2000: 顶顶更健康正在研究反向工程 有个傻B说破解了我的软件—哈哈!黄金屋手机MP3.MP4.3GP.电影.下载系统 ljx811216: 真有这事,看看 我的未来方向 pconline/asp.net周金桥老师的aspnet 友人Blog 旧博客在sina Bluesen的语音卡开发平台 JackXu的开源语音卡框架 经验丰富的好友:杨光的专栏 蓝星际语音平台,Koodoo语言 Lucene改造者-yuetiantian 西部.阿呆's blog manesking:全文检索c/c fullfocus研究lucene,nutch 黄国酬的博客 把“天轰穿”的asp.net 雨松.安卓