170 likes | 426 Views
PowerBuilder. School of Computer System Engineer UVAQ jcolivares@uvaq.edu.mx 19.72388 lat, -101.1848 long. M.C. Juan Carlos Olivares Rojas. Disclaimer.
E N D
PowerBuilder School of Computer System Engineer UVAQ jcolivares@uvaq.edu.mx 19.72388 lat, -101.1848 long M.C. Juan Carlos Olivares Rojas
Disclaimer Some material in this presentation has been obtained from various sources, each of which has intellectual property, so in this presentation will only have some rights reserved. These slides are free, so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on my part. In return for use, I only ask the following: if you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source.
Outline • Introduction • PowerScript • PowerDesigner • Conclusions
Objectives of theSession • The students will know a 4GL paradigm language: PowerBuilder. This is another programming language paradigm.
Imtroduction • PowerBuilder is development by Sybase. • It’s a powerfull database-oriented language (SQL Anywhere). • Actually implements service-oriented and object-oriented language. • It’s multiplatform. It has support to .NET and J2EE Platforms.
PowerScript Components Tab Page Tab WorkSpace Tab Language Tab ApplicationPainter (IDE)
PowerScript PowerScriptTargets Web Targets Types of Projects
Practice 1 • Developing Simple Applications • HelloWorld • sum two numbers (validate numbers, clean the form, exit) • Ecuations/Triangle • Developing a Simple Database Applications • Database about Location Services
Practice 1 // Comments integer n1 n1=integer(sle_nro1.text) if n1>0 then sle_nro2.setfocus() else sle_nro1.text="" sle_nro1.setfocus() end if
Practice 1 • The databases (tables) can be created through a Table Painter or creating a connection using a ODBC Painter. Int Emp_num Emp_num=Integer(sle_Number.Text ) UPDATE Employee SET emp_name = :sle_Name.Text WHERE Employee.emp_num = :Emp_num USING Emp_tran ; IF Emptran.SQLNRows > 0 THEN COMMIT USING Emp_tran ; END IF
SQL Statements • COMMIT {USING TransactionObject} ; • CONNECT {USING TransactionObject} ; • DELETE FROM TableName WHERE Criteria {USING TransactionObject} ; • DISCONNECT {USING TransactionObject} ; • INSERT RestOfInsertStatement {USING TransactionObject} ; • ROLLBACK {USING TransactionObject} ; • SELECT RestOfSelectStatement {USING TransactionObject} ;
SQL Statements • UPDATE TableName RestOfUpdateStatement {USING TransactionObject} ; If dw_profesor.Update()= -1 Then Rollback; MessageBox("Error",“Don’t save!",Exclamation!) Else Commit; MessageBox("Information", “Save correctly!!") End if
Other Statements CHOOSE CASE Expression CASE option1 Instruction Block CASE optionn2 Instruction Block CASE optionn Instruction Block CASE ELSE Instruction Block END CHOSE
Other Statements • DO WHILE conditionn • Instrucctions • LOOP • DO UNTIL condition • Instrucctions. • LOOP
Other Statements DO Instrucctions. LOOP WHILE condición DO Instrucctions. LOOP UNTIL condition FOR var=Initial TO final STEP (Increment) Instruction Block NEXT
References • Robison, D. and Pagna, J., (2008) , Wap 2.0 Mobile Web: XHTML Mobile Profile. • Kantor, P. (2006), XHTML, Desert Code 2006. • Skelton, G., Excell, P., Robison, D. and Taj, I. (2008) XHTML Basic and XHTML-MP. • Ingram, M. (2008) Mobile Devices: Driving Standards for a “New” Web.