首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到19条相似文献,搜索用时 203 毫秒
1.
控件是可视化开发工具的重要对象之一。在程序设计时通常会遇到具有相同性质的事件过程,如果为每个控件分别编写一段事件过程,则显得十分不经济且结构不合理。在面向对象的程序设计中可采用将多个相同的控件定义为一个控件数组,这个控件数组内的每一个控件都可以共享程序代码。这不仅减少了开发人员重复性劳动而且提高了程序的可读性。通常建立控件数组方法有两种:第一种是在设计阶段时建立,属于静态方式;另一种是在执行阶段,动态地建立控件数组,也即在程序执行时建立。为了避免内存的浪费常采用动态建立控件数组,就是在程序模块(module)内,先声明一个空的控件数组,等到要使用该控件数组时,再重新声明要使用的控件数组元素或数目。控件数组可以动态生成和释放;并且控件数组对属性具有相同控制。动态生成和释放控件数组是在运行时,用Load和Unload语句添加和删除控件数组中的控件。  相似文献   

2.
数组是编程语言中的一种基本数据结构,而控件是VB中最重要的对象之一.它们的结合使用给VB编程带来了极大的灵活性.一、控件数组的创建控件数组即由一组相同的控件名(Name属性相同)、不同下标(Index属性值连续)的控件组成的数组.在窗体中添加控件数组有两  相似文献   

3.
在使用C + +Builder时 ,由于VCL中缺少控件数组 ,因而使用起来不象VisualBasic中那样方便。但是C + +Builder可以利用其它的技术实现控件数组的所有的功能 :(1)允许多个控件共享同一事件句柄 ;(2 )提供了在运行期间增加一个控件的机制 ;(3)提供了一种方便的组合控件的方法。C ++Builder还有另一个优点 ,即不同类型的控件可以使用相同的事件句柄。这对于类似的控件 ,如掩码编辑控件与编辑控件能共享同样的事件代码 ,有很大的意义。至于控件的动态分配 ,C + +Builder并无VisualBasi…  相似文献   

4.
在VB中使用控件数组非常灵活,同样在C#中也可以实现控件数组的功能.从三个方面说明C#如何完成控件数组的功能,即对多个控件赋值,多个控件使用同一个事件处理程序,在运行时动态添加或者删除控件.  相似文献   

5.
姜军 《计算机时代》1998,(10):16-17
控件是可视化开发工具的重要对象之一.在用VB设计一个项目(PROJECT)时,常常会遇到具有相同性质的事件过程,比如在计算器中的数字按扭,它们不仅类型一样,而且执行的过程也一样.如果为每个按扭控件分别编写一段事件过程的话,则显得十分不经济以及结构不合理.就象在结构化程序设计中把相同的过程定义为子程序一样,我们也可以把多个相同的控件定义为一个控件数组,那么,控件数组内的每个控件都可以共享程序代码.通过控件数组的应用,使得开发人员不仅减少了重复劳动而且还提高了程序的可读性.将程序的执行过程定义为数组,这在非面向对象的程序设计中是不可能的.控件数组的建立有以下两种常用的方法:  相似文献   

6.
在设计基于VBA的Word试题模板时,发现在VBE环境下无控件数组,使得同类控件只能有分开的不同的事件过程,导致编程效率低。本文通过类设计实现同类控件具有相同的事件过程。在控件类的设计过程中,从类的概念和实践出发,得出控件可类化的一些属性和事件过程,对类属性的初始化采用了直接和间接的两种方法,给出了利用复选按钮进行单项选择的关键技术代码。  相似文献   

7.
居晓琴 《福建电脑》2007,(11):179-179,173
利用控件数组我们可以优化代码,本文主要介绍了在vb程序设计中不同的阶段建立控件数组的方法,我们可以根据不同情况采用不同的方法得以实现,为vb应用程序开发提供有力的参考.  相似文献   

8.
1.在Delphi中实现类似VB中的控件数组 你可以通过设置一组相应控件的TAG属性来实现这一功能。首先在窗体中放置3个BUTTON控件,然后分别设置这三个控件的TAG属性为1、2、3。接下来双击任意一个按钮,在其代码部分输入如下代码:  相似文献   

9.
一、VB中程序控制 1.数组、动态数组、控件数组。 1)普通数组 VB和其它语言一样,采用数组为其使用的变量保留内存空间。指定数组元素的号称为下标,并按下标顺序存储数组值。缺省时第一个元素的下标为0,使用Dim、Static、Global为声明不同类型的数组:  相似文献   

10.
王波  王鑫 《福建电脑》2011,27(9):175-175,201
vb的控件数组在vb程序设计时应用非常广泛,但是由于它与普通控件的不同性,使得在建立控件数组与使用控件数组的语法上也与普通控件不同。在建立方面,分为静态建立与动态建立两种,而使用时也是通过不同的(index)值来控制不同的控件元素。  相似文献   

11.
基于空间冲激响应的 Field II 软件是目前最广泛使用的超声模拟器, 尤其是在各种医学超声成像技术的研究上。为了提高 Field II 模拟超声成像的速度,充分利用当前多核与分布式计算资源,本文研究利用 Matlab 并行工具箱及分布式计算服务器来实现基于 Field II 的并行与分布式超声成像模拟。在这个平台上,可以确保不同扫描线的模拟工作可以自动划分到不同的计算节点或计算核上。通过与原始的只能单线程执行的 Field II 对比,无论是采用线阵探头还是相控阵探头,本文方法仅仅需要添加少量的代码就可以在多节点的计算机集群或多核计算机上实现快速的超声信号模拟。实验结果显示,当利用线阵探头扫描一个具有 10 万散射子的数字体模时,利用 32 个计算核它可以在 145 秒内模拟 64 条扫描线;当利用相控阵探头扫描一个具有 100 万散射子的数字体模时,利用 32 个计算核它可以在 4910 秒内模拟 128 条扫描线,对应的加速比分别为 22 和 25.5。  相似文献   

12.
In pervasive computing environment, users can access to various information, resources and services at anytime and anywhere, so access control has become an exigent security problem. In the traditional access control modes, the decisions o[ access control are entirely dependent on the results of authentication. The access control can-not provide the security-relevant fault-tolerant function. But in pervasive computing environment, because of the var-ious reasons, security system can't assure the results of the authentication are absolutely correct. So we propose touse the knowledge-based access control, which can discovery some rules and knowledge from the previous process ofaccess control and combine these rules with traditional access controls to perfect the security system. The essence ofknowledge-based access control is to add some intelligent authentication function into the process of access control. In the paper, we expatiate the idea and principle of knowledge-based access control, as well as the advances of this method. Furthermore, we implement a prototype, called EH-GRBAC, which can discovery historical knowledge from the history of users' using resources to reinforce GRBAC. In the paper, we also explain the architecture and the details of EH_GRBAC.  相似文献   

13.
Source code comments are a valuable instrument to preserve design decisions and to communicate the intent of the code to programmers and maintainers. Nevertheless, commenting source code and keeping comments up-to-date is often neglected for reasons of time or programmers obliviousness. In this paper, we investigate the question whether developers comment their code and to what extent they add comments or adapt them when they evolve the code. We present an approach to associate comments with source code entities to track their co-evolution over multiple versions. A set of heuristics are used to decide whether a comment is associated with its preceding or its succeeding source code entity. We analyzed the co-evolution of code and comments in eight different open source and closed source software systems. We found with statistical significance that (1) the relative amount of comments and source code grows at about the same rate; (2) the type of a source code entity, such as a method declaration or an if-statement, has a significant influence on whether or not it gets commented; (3) in six out of the eight systems, code and comments co-evolve in 90% of the cases; and (4) surprisingly, API changes and comments do not co-evolve but they are re-documented in a later revision. As a result, our approach enables a quantitative assessment of the commenting process in a software system. We can, therefore, leverage the results to provide feedback during development to increase the awareness of when to add comments or when to adapt comments because of source code changes.  相似文献   

14.
基于LTE-Advanced标准的LDPC码编码器设计与实现   总被引:1,自引:0,他引:1  
针对LTE-Advanced标准,在分析其低密度奇偶校验(LDPC)码校验矩阵构造基础上,设计了一种低成本高吞吐率的准循环LDPC码编码器结构。通过分析校验矩阵的子矩阵结构,将整个校验矩阵划分为全零子矩阵及循环移位单位子矩阵的块状结构,进行串行编码。实验结果表明,与同类方法相比,设计的编码器编码时间约为同类最理想时间的32%,资源消耗约为同类最理想情况的33%,在编码时间和资源消耗上达到平衡,满足LTE-Advanced标准低成本高传输的要求。此外,改变校验矩阵存储单元的参数,可实现不同码长码率的LDPC码编码。  相似文献   

15.
余剑  崔琛 《微计算机信息》2006,22(6):272-274
虽然在.Net托管环境下不支持对非托管COM组件的直接访问,但大量的COM组件在.Net平台下仍是可用的宝贵资源。本文通过对COMInterop技术的分析,介绍了在托管环境下实现访问COM组件的方法。文中特别阐述了对指针数组、事件以及异常处理等情况在.Net下的正确处理方法,并给出了类型库导入工具、MSIL汇编工具和MSIL反汇编工具的使用方法,最后总结了实现托管代码与COM类型交互的注意事项。  相似文献   

16.
为了在高吞吐量应用程序中快速进行测量来监视物理过程,论文将通信吞吐量传输到中心服务器之前的测量数据预过滤过程转化为代码路径分支混淆技术,并将其视为二进制分类问题。利用决策树与随机随机森林构建了每种体系结构并提出了不同的实现方案,使用改进的冯·诺依曼体系结构的CPU理论模型和现场可编程门阵列(FPGA)来构建计算体系结构,并在FPGA上实现随机森林的应用。所提方法在Zedboard开发板上进行了实验,试验结果表明所提方法能有效地提高吞吐量和资源量,且降低了主板设备的功耗。  相似文献   

17.
In this paper, we introduce a functional language which facilitates the mobility of code between the sites of a distributed system. We observe that code mobility renders systems with limited resources vulnerable to denial-of-service attacks. Languages which are designed with the objective of preventing these attacks would benefit from static analysis which can expose the resource consumption of programs. In functional computation there is a close connection between the consumption of resources and the flow of control within the system. We show that it is possible to exploit type systems to perform distributed control flow analysis and discuss the potential applications of such analyses in promoting security of resource-sensitive systems.  相似文献   

18.
Parallel code presents a non-trivial problem of load balancing computational workload throughout a system of hardware and software resources. The task of load balancing is further complicated when the number of allowable processors changes through time. This paper presents a two-component load-balancing mechanism using optimal initial workload distribution and dynamic load maintenance. The initial guess is provided by inversion of the workload distribution function. Workload distribution inversion enables efficient domain decomposition for arbitrary workloads and easily compensates for changes in system resources. Dynamic load balancing is provided by process feedback control as used, for example, in control mechanisms of physical processes. Proportional, integral, and differential (PID) feedback readily allows controls to compensate for runtime-changes of the workload distribution function. This paper demonstrates a one-dimensional realization of the ideas presented here. We apply this load-balancing technique to our gridless direct simulation Monte Carlo algorithm. We demonstrate that the method does indeed maintain uniform workload distribution across available resources as the workload and usable system resources undergo change through time.  相似文献   

19.
safeDpi: a language for controlling mobile code   总被引:11,自引:0,他引:11  
safeDpi is a distributed version of the Picalculus, in which processes are located at dynamically created sites. Parametrised code may be sent between sites using so-called ports, which are essentially higher-order versions of Picalculus communication channels. A host location may protect itself by only accepting code which conforms to a given type associated to the incoming port. We define a sophisticated static type system for these ports, which restrict the capabilities and access rights of any processes launched by incoming code. Dependent and existential types are used to add flexibility, allowing the behaviour of these launched processes, encoded as process types, to depend on the host's instantiation of the incoming code. We also show that a natural contextually defined behavioural equivalence can be characterised coinductively, using bisimulations based on typed actions. The characterisation is based on the idea of knowledge acquisition by a testing environment and makes explicit some of the subtleties of determining equivalence in this language of highly constrained distributed code.  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号