Object Oriented Powerscript Programming Software Foundry-Books Pdf

Object Oriented PowerScript Programming Software Foundry
01 Apr 2020 | 22 views | 0 downloads | 48 Pages | 915.36 KB

Share Pdf : Object Oriented Powerscript Programming Software Foundry

Download and Preview : Object Oriented Powerscript Programming Software Foundry


Report CopyRight/DMCA Form For : Object Oriented Powerscript Programming Software Foundry



Transcription

Basic Elements of the PowerScript Programming Language 1. Level of Abstraction 2, Language Syntax Semantics and Control Statements 6. Dot Notation 7,Pronouns 7,Variables 8,Operators 9,Expressions 10. Command Statements 10,Functions and Events 12,Subprograms 13. Modules 13,Assignment,Assignment 13,Type Checking 14. Fundamental PowerScript Concepts 15,Data Types 15,Any Type 16.
Enumerated Types 16,Standard Types 17,Class Types 17. Composite Types 18,Structures 18,Arrays and Strings 21. Attributes or Properties 22,Declarations 22,Access Rights 25. Messages and Methods 26,Message Direction 26,Message Access Rights 26. Message Name Resolution 27,Message Timing 28,Message Parameters 28.
Method Computational Intensity 28,Method Location 29. Encapsulation 29,Inheritance 30,Polymorphism 31,Static and Dynamic Typing 32. Inclusion Polymorphism 33,Operational Polymorphism 34. System Class Library 34,Programming Style and Design Considerations 39. Programming Styles Supported by PowerBuilder 40,Procedural Style 40.
Object Based Style 41,17 MARCH 1998 POWERSCRIPT WHITE PAPER. Object Oriented Style 41,Strongly Typed Object Oriented Style 41. Weakly Typed Object Oriented Style 41,Difficulties of Mixed Styles 42. Guidelines for an Object Oriented Programming Style 42. Class Design 42,Hierarchy Design 43,Design vs Implementation 43. Program Code Conventions and Standards,Standards 43.
Considerations when Naming Variables 44,Summary 44. II 1996 AUSTIN SOFTWARE FOUNDRY,The PowerScript Language. This paper covers the basic concepts and structure of the PowerScript language focused on. using it for object oriented programming Object oriented programming languages actually have. a great deal in common with procedural languages so this paper also approaches PowerScript. within a framework that can be applied to any programming language This is valuable for a. couple of reasons First understanding a programming language s underlying principles and. structure can save you considerable time and effort by providing clear guidelines for using it. correctly Second you should be able to use this framework to compare whatever other. programming language you re most familiar with to PowerScript and ease your transition to this. very powerful new language, The paper assumes you are already familiar with the main features and syntax of PowerScript. from your previous PowerBuilder programming so it is not an exhaustive detailed presentation. of the syntax Instead it is designed to give you a solid understanding of PowerScript as a. programming language not just scripts used inside of a GUI builder as is often the mistaken. impression of PowerBuilder and PowerScript If you re not familiar with the language syntax your. PowerBuilder manual and online help system are the best place to turn for these specifics. Throughout the rest of the book I ll assume if you are uncertain of the syntax in an example that. you ll turn to the documentation for clarification Instead of syntax this paper presents the. broader concepts you need to work with the newest release of PowerBuilder and lays the. foundation for future discussion of the most important and often misunderstood feature of the. language object references It also presents the basic programming styles provided in the. language and helps you decide which is best suited to your task and experience level. With the release of PowerBuilder 5 0 the PowerScript language has several new and long. awaited features One of the most obvious is the new editor with color coding which can be. customized in the PowerScript painter property sheets to identify datatypes system level. functions flow of control statements comments and literals It will automatically indent scripts. based on flow of control statements These features make the language in general much easier. to use The key language enhancements are the addition of constants changes in how you. access global variables and better detection when a global overrides a local variable new ways. to control the access to a particular variable function name overloading and a series of. enhancements to functions and events Most of these enhancements have been added in. response to the needs of a maturing and more sophisticated programming community and are. aimed at experienced PowerBuilder and object oriented developers This paper will give you a. place to begin as you start to assimilate these features into your everyday PowerBuilder. programming repertoire, Basic Elements of the PowerScript Programming Language. The introduction of the PowerBuilder visual development environment five years ago was a. breakthrough for everyone involved in writing high level software applications applications. above the level of things like device drivers memory management utilities and commercial. applications like word processors and spreadsheets for the Windows environment It shielded. us from the complexity of the Windows Software Developer s Kit API and C or C memory. management It transformed a large portion of our programming tasks describing our. application to the computer in terms of program code text into painting tasks where we. 17 MARCH 1998 POWERSCRIPT WHITE PAPER, describe our application by drawing it and letting PowerBuilder generate the code for the.
computer to execute But even with the visual programming tools in PowerBuilder we still have. to write event scripts and functions in program text in order to help PowerBuilder generate all of. the code necessary for a complete application In fact as the complexity of your PowerBuilder. applications grow and you begin to use more sophisticated techniques like application. partitioning and nonvisual objects it s necessary to write more and more actual code in. PowerScript PowerScript is a relatively simple language to learn since its syntax is similar to. languages most of us have learned Basic Pascal C etc In fact the syntax was largely. modeled on Microsoft QBASIC The simplicity of the syntax and the visual tools provided in the. PowerBuilder environment tend to hide some of the very powerful elements of PowerScript. mainly the object oriented features drawn from C Eiffel and Smalltalk In order to uncover this. power and learn to harness it it helps to understand some basic principles and concepts. underlying the PowerScript programming language It is also very helpful to study QBASIC C. Eiffel and Smalltalk to develop a broader understanding of the whys of the PowerScript. language We ll start by examining the seven basic elements of a programming language and. how they are implemented in PowerScript,Level of Abstraction. All programming languages provide some level of abstraction above the level at which the. computer actually executes instructions I ll never forget one of my first programming classes at. The University of California at Berkeley My professor introduced us to programming by having. us write a simple program IN BINARY on a DEC PDP 11 We actually had to key the program in. with toggle switches where up meant 1 and down meant 0 That was tedious Next he taught. us assembly language and then C It was one of the hardest courses I took but probably the. most valuable The binary routines we wrote were directly implemented by the computer and. gave us complete control over things as basic as how the computer booted itself but would have. been impossible to use to write a business application Binary programs like this could be. considered first generation programming languages Assembler a second generation language. was an improvement in programming efficiency and still gave us very precise control over the. use of the computer s internal registers and memory structure The problem was except for. tasks that required this level of control it still wasn t terribly efficient to program in assembler. Our next language C still provided access to many of these low level aspects of the computer. but gave us higher level abstractions like data types for example float char and int structures. arrays flow of control statements and functions These made it much more efficient to structure. and write applications for more general problems like business systems word processors and. even compilers C and other languages like Fortran COBOL and Pascal are considered to be. third generation languages three steps removed from the hardware. Each level of abstraction away from the computer has two consequences First it improves the. efficiency of the programmer using it by providing language elements that automate lower level. functionality Second details are lost as higher level abstractions are used This is an obvious. tradeoff the efficiency of the programmer versus access to low level details of the computing. environment The trick is to optimize this tradeoff Those of us building business applications. with PowerBuilder certainly need to optimize our development time and likely don t need access. to bit level memory manipulation Where we do PowerBuilder provides access to lower level. languages like C and C through external function calls. Like C and other object oriented languages PowerScript provides one very important. abstraction beyond C Fortran COBOL and Pascal It provides the ability for programmers to. define their own new data types Integers doubles and floats are useful data types I ll refer to. these as standard data types or abstractions A data type is simply a set of values and a set of. operations on those values An integer is a number and you can add subtract multiply and. 2 1996 AUSTIN SOFTWARE FOUNDRY,POWERSCRIPT WHITE PAPER 17 MARCH 1998. divide them But these standard data types alone are not sufficient abstractions for all problems. encountered by programmers In fact it would be unrealistic to expect language designers to be. able to come up with all of the abstractions needed by programmers Instead object oriented. languages allow programmers to define their own data types or abstractions using yet a higher. level abstraction from procedural languages a class A class is created by combining lower. level abstractions like floats integers and functions A class used at runtime is called an object. and is similar to a variable it s just more complex Like a variable that is created from the. standard data types integer or string and used at runtime to hold actual data a class is used to. define objects for use at runtime that hold actual data We ll spend lots of time discussing how. and when to use classes and objects through the rest of the book An example of a simple class. definition the definition of a new data type is shown in the following listing of exported. PowerScript syntax This definition is very similar in content if not exact syntax to the definition. of a class in C Smalltalk or Eiffel The example is the definition of a book data type for an. on line library catalog application,001 forward,002 global type n book from nonvisualobject. 003 end type,004 end forward,005 global type n book from nonvisualobject. 006 end type,007 global n book n book,008 type variables.
009 Private,010 Protected,011 stringis title,012 stringis author. 013 Public,014 end variables,015 forward prototypes. 016 public function boolean nf set title string as new title. 017 public function boolean nf set author string as new author. 018 end prototypes, 019 public function boolean nf set title string as new title IF NOT. IsNull as new title THEN,020 is title as new title. 021 RETURN TRUE,023 RETURN FALSE,024 END IF,025 end function.
1996 AUSTIN SOFTWARE FOUNDRY 3,17 MARCH 1998 POWERSCRIPT WHITE PAPER. 026 public function boolean nf set author string as new author IF NOT. IsNull as new author THEN,027 is author as new author. 028 RETURN TRUE,030 RETURN FALSE,031 END IF,032 end function. 033 on n book create,034 TriggerEvent this constructor. 035 end on,036 on n book destroy,037 TriggerEvent this destructor.
038 end on,Listing 1 PowerBuilder class definition of n book. There is a tendency when first learning a programming language to focus on how to make the. language perform actions using its statements and commands especially in procedural. languages These are certainly important abstractions that a higher level language provides for. us After all the goal of a program is to do something right But in object oriented programming. languages statements and commands are used to manipulate the data used to represent. another abstraction some new object And that s the critical leap to make using objects as the. primary abstraction for designing and structuring your programs It s pretty hard to design a. program using an abstraction you re unfamiliar with so studying the lower level aspects of the. language that will allow you to structure how these objects are represented is where we need to. focus next, What do I mean by data in the context of a programming language Webster s Dictionary. defines datum the singular form of data as a fact on which reasoning is based In the context. of a computer or a programming language we often use the term data to mean the electronic. representations of facts that we can then apply various operations to In order to store facts or. data in the computer we have to identify what type of data must be stored so the computer. knows how to store it and what operations can be applied to it so the computer knows what it. can to do with that data In PowerScript an integer is a type of data that can take on a finite set of. values from 32 768 to 32 767 uses 16 bits of memory and can have a set of operations. applied to it including addition subtraction multiplication and division The book class n book. in the previous listing is a type of data that can take on an infinite combination of values for title. and author takes 1 400 bytes of memory and can have operations applied to it to set new. author and title values So two of the most important concepts related to data in a programming. language are the type of data to be stored and the operations that can be applied to it I ll. discuss the types of data in more detail later in the paper. There are essentially five categories of data used in PowerScript literals variables constants. enumerations and composites Literals are specific values used directly in the body of your. 4 1996 AUSTIN SOFTWARE FOUNDRY,POWERSCRIPT WHITE PAPER 17 MARCH 1998. programs such as 365 3 14159 x FALSE or Joe The value of a literal is fixed A variable is. a name given to the spot allocated in memory to hold a value of a specific type of data like an. integer or a string The value in that spot can change during the course of a program A. constant is the name given to a variable that cannot change value during the course of the. program The release of PowerBuilder 5 0 brings a new keyword CONSTANT to your. PowerBuilder programming repertoire You can use this keyword to modify any declared variable. of a standard or enumerated type to be a constant Doing so changes it from a variable that is. evaluated at runtime as all were formerly to one that is evaluated at compile time After you. declare a constant you can use it anywhere you would use a value but if you try to assign to it. the compiler will flag it as an error An enumeration is a variable that can be assigned a fixed. set of values Values of enumerated data types always end with an exclamation point An. example is the WindowType attribute of a window in PowerBuilder It can only take on the finite. set of values Main Child Popup Response MDI and MDIHelp Finally a composite is a. combination of one or more variables constants or enumerations They can hold any amount. and type of data defined by the programmer Arrays structures and objects are examples of. composite data They typically have certain unique operations that can be applied to them to. make them more convenient to use The next listing shows examples of these five categories. 001 Ernest is a Literal,002 IF is author Ernest THEN RETURN. 003 is author and ii num pages are Variables,004 stringis author.
005 integer ii num pages,006 IS HOMECITY and IR PI are Constants. 007 constant string IS HOMECITY Austin,008 constant real IR PI 3 14159265. 009 ie toolbaralignment and ie windowstate are Enumerations. 010 ToolBarAlignment ie toolbaralignment,011 ie toolbaralignment AlignAtTop. 012 WindowState ie windowstate,013 ie windowstate Normal. 014 iwi main and inv book are Objects,015 w main iwi main.
016 iwi main CREATE w main,017 n book inv book,018 inv book CREATE n book. Listing 2 Five categories of data used in PowerScript. The last example in the listing is probably the newest to you and is what distinguishes object. oriented languages from procedural languages We ll spend much more time on it throughout. the rest of the book because it s not quite this simple All of the categories discussed above can. be used to create a composite data type A class definition is the most complex form of. composite data because you can define new operations on it functions and events which you. can t do for arrays and structures The class definition is then used to declare and create an. 1996 AUSTIN SOFTWARE FOUNDRY 5,17 MARCH 1998 POWERSCRIPT WHITE PAPER. object as in the last example in the previous listing Once you have created objects in your. program you can then manipulate them using their operations In order to do this you ll need. some commands and statements to control the flow of your program. Language Syntax Semantics and Control Statements, The syntax of a programming language is a set of rules that define what sequences of symbols. are considered to be valid expressions or programs in the language This set of rules is. expressed using a formal notation I have often remarked to students that PowerScript is almost. syntax less What I mean is that the set of rules for expressions is very small The release of. PowerBuilder 5 0 may cause me to think twice before I make that remark again because it does. introduce a significant number of new rules to the language Even so the syntax of almost any. programming language is the easiest part to learn and I still believe that the PowerScript syntax. is simple and straightforward It s the semantics of the language that can be difficult to learn. By semantics I am referring to the meaning of an expression in the specific context of a. program The bull is in the pen and The ink is in the pen require a deeper understand of. English than just sentence structure syntax The context and underlying meaning are essential. to understanding which type of pen is being referred to At any point in time during its. execution the context of a program can be described by its state the current contents of. memory and the next instruction that s about to be executed That next instruction will change. the state of the program but will it result in a correct state and exactly what are all of the. implications of this change to the program s state It s necessary to understand what s in. memory and how the next instruction will affect memory to be sure that the state change will. result in the desired new state In the following example listing what do you need to know to. figure out what will happen at runtime when lines 002 and 003 are executed This question has. to do with object references the subject of another paper. 001 Clicked event for m checkoutbook,002 inv book inv library item. 003 inv book TRIGGER DYNAMIC FUNCTION CheckOut,Listing 3 PowerScript semantics.
The Eiffel object oriented programming language actually has a syntax for testing the state of a. program and ensuring that an instruction started and ended with a valid state These are called. assertions in Eiffel and result in extremely robust programs They can help insure that in. situations like the one in the example above the program is in a valid state to execute those lines. of code We don t have assertions in PowerBuilder but with a solid understanding of what s. going on behind the scenes and some programming discipline you can program this kind of. reliability into your PowerBuilder applications, PowerScript language syntax consists of 14 basic elements comments identifiers dot notation. labels reserved words pronouns statement continuation and separation white space. variables operators expressions command statements functions and events and SQL. statements I don t plan to cover all of these elements Many of them are straightforward and. presented well in the product documentation on the PowerScript language I will cover only those. that are either key to using the object oriented features of PowerBuilder or are not presented in. the documentation,6 1996 AUSTIN SOFTWARE FOUNDRY,POWERSCRIPT WHITE PAPER 17 MARCH 1998. Dot Notation, Dot notation is a technique used in object oriented languages in order to extend procedural style. variable and function names so they can be referenced from outside of an object they are. declared within A variable or function may be preceded by one or more object names each. separated by a dot An example is a control cb OK inside of a main window w main This. control contains a variable called Text and a function called Resize width height A program. or object outside of the window this control is displayed on can access these members of cb OK. with the following dot notation,001 w main cb OK text Save. 002 w main cb OK resize 400 100,Listing 4 PowerScript dot notation.
The attribute or property and function Text and Resize width height respectively are said. to be members of cb OK and cb OK is said to be a part of w main. In PowerBuilder 5 0 dot notation has been extended to DataWindow objects both within. DataWindow controls and within the new DataStore nonvisualobjects A DataStore is nothing. more than a DataWindow object embedded within a nonvisualobject The nonvisualobject acts. like a wrapper around the DataWindow object just like a DataWindow control does In order to. reference a specific value in a DataWindow object inside either a control or nonvisualobject you. can now use the following dot notation syntax, 001 Access a data value within a DataWindow object. 002 dwcontrol Object columnname buffer datasource,003 datastore Object columnname buffer datasource. 004 Access a nested object within a DataWindow object. 005 dwcontrol Object objectname attribute,006 datastore Object objectname attribute. Listing 5 PowerScript dot notation for DataWindow and DataStore object. There are four pronouns in PowerScript THIS PARENT PARENTWINDOW SUPER They. are described in the PowerScript documentation as generic references to objects Additionally it. is important to recognize that they are actually expressions that are evaluated computed each. time they are encountered in a program The resulting value they return is a reference to an. object THIS computes a reference to the object itself PARENT computes a reference to the. object that contains the object itself PARENTWINDOW computes a reference to the window. that contains a Menu object SUPER computes a reference to an object s immediate ancestor. These references can the be used directly,001 Close THIS. 1996 AUSTIN SOFTWARE FOUNDRY 7,17 MARCH 1998 POWERSCRIPT WHITE PAPER.
Listing 6 PowerScript pronouns, or assigned to a variable and used in subsequent expressions without recomputing them. 001 window lwi this,002 lwi this THIS,003 RETURN lwi this. Listing 7 PowerScript pronouns in expressions, The implication of the second usage is that it will always be more efficient to use the pronouns to. compute a reference once assign it to a variable then reuse that variable throughout a given. script PowerBuilder then doesn t have to recompute the value of the pronoun every time it. encounters it separately in the program There are also other implications to this characteristic of. pronouns that we ll cover in a future publication, Variables within PowerBuilder are one of the significant discussion in a future publication but I ll. review a few aspects of them here along with a new feature in PowerBuilder 5 0 The key to. preparing yourself for the discussion of references is to remember that variables are nothing. more than a name for a spot in memory That spot may contain an integer a string an object. or any other legal data type in PowerBuilder Variables in PowerBuilder can have one of four. levels of scope local instance shared or global Variables with instance scope are declared. within a class definition and are owned by each instance or object of that class declared at. runtime in the program These instance variables have an additional property attached to them. access rights This property is discussed in more detail later in this paper but briefly an instance. variable can have public protected or private access rights Public access rights means the. variable is visible to all other objects protected access rights means it is visible only to. descendants of the object where it is declared members of that object s family tree and. private access rights means that no script outside of the object where the variable was declared. has access to it PowerBuilder 5 0 has added a new twist to variable access however. Access rights refers to the visibility of an instance variable outside of the class it is declared in. The new property of instance variables is read write access In addition to controlling the visibility. of an instance variable you can now control modifications to the value s it contains Public. instance variables can be declared to have PROTECTEDREAD PROTECTEDWRITE or. PRIVATEREAD PRIVATEWRITE Protected instance variables can be declared to have. PRIVATEREAD PRIVATEWRITE Private instance variables don t need any further protected. since they aren t visible anyway These keywords behave very similar to the PROTECTED and. PRIVATE access rights keywords For example PROTECTEDREAD means only scripts for the. object and its descendants can read the variable PROTECTEDWRITE menace only scripts for. the object and its descendants can change the value of the variable Thus the following. declaration of an instance variable,8 1996 AUSTIN SOFTWARE FOUNDRY.
POWERSCRIPT WHITE PAPER 17 MARCH 1998,001 Public,002 PROTECTEDWRITE string is customer. Listing 8 Instance variable declarations, would result in all scripts in an application being able to access is customer but only scripts in. the customer object or its descendants could modify its value I don t recommend the use of. these new keywords in a fully object oriented application since they encourage you to allow full. or partial violations to the principle of encapsulation They are one of those language features. provided by Powersoft for programmers who are not comfortable yet with the object oriented. programming style We ll discuss the various programming styles that PowerBuilder can support. later in the paper and I ll make some recommendations of things to use and to avoid with each. The operators provided in PowerScript are relatively straightforward and fall into 5 categories. arithmetic logical relational NOT AND OR concatenation. and navigation object member object nestedobject globalvariable Except for the. navigation operators which are difficult to find any reference to in the documentation and are. related exclusively to object oriented programming the operators provided by PowerScript are. relatively standard and should not be a source of mystery or confusion The navigation. operators on the other hand may be somewhat mysterious. The three navigation operators in PowerScript are referred to as membership object member. nested object object nestedobject and global scope globalvariable operators They all. provide ways to navigate among references to objects The first two provide mechanisms for. navigating among related objects in an inheritance hierarchy or in an aggregation respectively. The global scope operator provides a mechanism for navigating among object references in an. application The membership operator separates an object reference from a member function or. event The nested object operator separates a parent object reference from a child object. reference in an aggregation The global scope operator forces PowerBuilder to use a global. variable even if there is a local or shared variable with the same name The only acceptable use. of a global variable in object oriented programming is as a reference to an object so this. operator will allow you to force PowerBuilder to skip over local and shared object references to a. global reference The examples in the following listing should give you some ideas of the. combinations that are possible, 002 Script in the constructor of the commandbutton w dialog cb 1. 003 inherited from w main cb 1, 005 Referencing a member function in the ancestor The following. 006 statements achieve identical results,007 w main cb 1 uf settext.
008 w main cb 1 uf settext,009 w main cb 1 FUNCTION uf settext. 1996 AUSTIN SOFTWARE FOUNDRY 9,17 MARCH 1998 POWERSCRIPT WHITE PAPER. 010 SUPER uf settext, 011 SUPER uf settext this statement does not compile. 012 Referencing a member event in the ancestor The following. 013 statements achieve identical results,014 w main cb 1 TriggerEvent clicked. 015 w main cb 1 TriggerEvent clicked,016 w main cb 1 EVENT clicked.
017 SUPER TriggerEvent clicked, 018 SUPER TriggerEvent clicked this statement does not compile. 019 CALL w main cb 1 clicked, 020 Referencing a member attribute in the ancestor The following. 021 statements achieve identical results,022 string ls text. 023 ls text w main cb 1 Text this statement does not compile. 024 ls text w main cb 1 Text, 025 ls text SUPER Text this statement does not compile. 026 ls text SUPER Text this statement does not compile. Listing 9 PowerScript navigation operators, It s important to notice that the only consistent way to reference members of objects is through.
dot notation as in lines 008 009 016 017 026,Expressions. An expression is made up of a combination of one or more literals variables operators. pronouns and functions or events An example of an expression is counter 1 PowerBuilder. will evaluate this expression and add 1 to the value stored in the variable location named. counter They can occur in PowerBuilder in many places assignment statements counter. counter 1 boolean expressions in IF THEN statements limits of FOR NEXT and. DO WHILE loops parameters of functions or events DataWindow column validations etc The. important concept beyond the syntax of expressions is that wherever an expression is located it. is evaluated and produces a value The value is then used based on the context of the. expression In an assignment statement the value of the expression is assigned to a variable In. an IF THEN statement the value is used to determine how to execute the IF THEN statement. This characteristic that an expression produces a value will be important when I discuss. assignment statements below Beyond that expressions in PowerScript are similar to. expression in C C Pascal etc and are relatively straightforward. Command Statements, PowerScript provides four categories of command statements assignment object. management control and SQL statements I will discuss the assignment statement below SQL. statements are largely beyond the scope of this book and I presume you are familiar with. Structured Query Language Control statements can be further broken down into three. categories of their own jump choice and loop statements Jump statements include CALL. 10 1996 AUSTIN SOFTWARE FOUNDRY,POWERSCRIPT WHITE PAPER 17 MARCH 1998. and GOTO and are discouraged in both structured or procedural and object oriented. programming styles Choice statements include the forms of IF THEN and CHOOSE CASE. statements Loop statements include FOR NEXT and DO WHILE statements These are. standard implementations and should be familiar to you from other programming languages. One note about choice statements that you should observe as you are expanding your use of. object oriented programming is that there should be fewer and fewer of them in your code as. you learn to take advantage of polymorphism This is one of the primary characteristics of. polymorphism It is a mechanism built into an object oriented language for automatically making. choices among alternate forms of operations so you don t have to do it within your scripts If. you find yourself programming extensive IF THEN or CHOOSE CASE statements to. determine the type of an object you want to operate on this is a sure sign that you should revisit. your design and that it is not very object oriented. Finally there are the object management statements CREATE and DESTROY The CREATE. statement allocates memory for and creates in that memory space an instance of a class. n book below The CREATE statement also returns a reference to that spot in memory which. you must capture in a variable lnv book below if you want to reference that instance of the. class or object later in a script These references are the topic a future publication There are. two forms of the CREATE statement The first only requires that you supply the class name as a. literal that you want used to define and allocate the memory space being created An example is. 001 n book lnv book,002 lnv book CREATE n book,Listing 10 PowerScript object creation. The second allows you to supply the class as a string variable at runtime For example. 001 string ls classname,002 nonvisualobject lnv objectreference.
003 ls classname n book,004 lnv objectreference CREATE using ls classname. Listing 11 PowerScript object creation using a variable. The DESTROY statement releases the memory allocated by the CREATE statement. PowerBuilder does very little automatic garbage collection for objects If you CREATE an object. you should use the reference you obtained to destroy it when you no longer need it In a couple. of situations even if you didn t create an object you must destroy it if you used it The primary. examples are the DataWindow DWObject and the OLEObject Once you obtain a reference to. either one of these even though they were created by PowerBuilder you must manually destroy. them The act of obtaining a reference causes PowerBuilder to override its automatic deletion of.

Related Books

#27547 Metal Presentation Cart - lib.store.yahoo.net

 27547 Metal Presentation Cart lib store yahoo net

3 #27547 Metal Presentation Cart Assembly Diagram Identify and Separate all the Parts and Hardware. Place the LCD Platform (P-3) with the insert nuts

WASTEWATER REUSE STANDARDS FOR AGRICULTURE IRRIGATION IN ...

WASTEWATER REUSE STANDARDS FOR AGRICULTURE IRRIGATION IN

WASTEWATER REUSE STANDARDS FOR AGRICULTURE IRRIGATION IN, EGYPT Mohamed ELSayed Gabr Assistant Professor, Civil Engineering Department, High Institute for Engineering and Technology, New Damietta, Ministry of High Education, Egypt., E-mail: m_egabr@yahoo.com ABSTRACT Water quality is a vast and very complex topic.A complete definition of the wastewater reuse standards for agriculture ...

Wastewater treatment and reuse in Alicante (Spain)

Wastewater treatment and reuse in Alicante Spain

Wastewater treatment and reuse in Alicante (Spain) A. Arahuetes Inter-university Institute of Geography, University of Alicante, Spain Abstract The treatment of wastewater in the province of Alicante (Spain) has experienced a positive evolution during the last few decades in that it was able to treat the volumes generated by the increasing population and adapt itself to the provisions of the ...

Comprehensive Family Planning Training Evaluation Report

Comprehensive Family Planning Training Evaluation Report

increase access to anddemand for long-term family planning methods. To achieve these goals, the FMOH is building capacity of health care providers to provide quality family planning services, ensuring a continuous supply of family planning commodities at health facilities, and monitoring and evaluating theinterventions.

Improving Quality of Postpartum Family Planning in Low ...

Improving Quality of Postpartum Family Planning in Low

2 Improving Quality of Postpartum Family Planning in Low-Resource Settings risk of stillbirth, miscarriage, and child illness. Pregnancies before age 18 are associated with increased risk of postpartum hemorrhage, pre-term birth, stillbirth, school dropout, and poverty [9]. Globally, child marriage (defined as marriage under the age

A Magical Society: Guide to Mapping

A Magical Society Guide to Mapping

Ecology and Culture. Within those covers you will find help filling your world with biomes, ecological wonders, and cultural groups If you want to expand upon the ideas presented in this free PDF, pick up A Magical Society: Ecology and Culture from your FLGS or from rpgnow.com. The book will be available in April 2004, and the PDF

Medical Assistants Improving Medication Safety

Medical Assistants Improving Medication Safety

Medical Assistants: Improving Medication Safety and Competency Assessment Franklin Square Hospital Center Program/Project Description. Medical Assistants (MAs) play a vital role in ambulatory settings, providing clinical and clerical support to physicians. Clinical skills range from basic vital signs and measurements to injections, phlebotomy, administering inhalants, and performing 12-lead ...

1989 Skeeter rebuild

1989 Skeeter rebuild

Skeeter trailer and boat cover. CUT ALONG DOTTED LINE ITEM DESCRIPTION COLOR PRICE EACH S M L XL QUANTITY EXT. PRICE A. High Performance Competition Jacket $90.00 B. High Performance Life Jacket 85.00 C. Black Corduroy Winter Hat 9.95 D. Black/Red Summer Hat 6.75 E. Red Corduroy Winter Hat 9.95 F. Lemans Competition Jacket 90.00 G. Sweaters 35.95 H. Tee Shirt 12.95 I. Sports Shirt 29.50 J ...

CV of Xin-Yuan Liu - SUSTech

CV of Xin Yuan Liu SUSTech

Lei Li, Zhong-Liang Li, Qiang-Shuai Gu, Na Wang, Xin-Yuan Liu,* "A Remote Radical Vinyl Migration Strategy to Access Medium- and Large-sized Cyclic Alkenes" Sci. Adv. 2017 , 3 , e1701487.

Analisis Strategi Bauran Pemasaran Minuman Kopi ...

Analisis Strategi Bauran Pemasaran Minuman Kopi

Pemasaran Langsung Hubungan Masyarakat Tenaga Penjualan nilai di atas Kuesioner Kuesioner pada penelitian ini berisi pertanyaan terkait dengan keputusan pemilihan strategi pemasaran. Pada penelitian digunakan dua jenis kuesioner, yang pertama untuk pembobotan AHP dan kuesioner kedua untuk pemberian skor pada metode TOPSIS.