Hyderabad Jobs Book Website FREE PowerBuilder Training I Love Hyderabad Hyderabad Colleges
Home Business Emails Hyderabad Classifieds Contact Us
7 Wonders of Hyderabad Web Hosting Yellow Pages Our Network

 
Webpowerbuilder.hyderabad-colleges.com

Introduction to PowerBuilder

HomePrevious Lesson: Customizable Web links on PowerBuilder Menu
Next Lesson: PowerBuilder Environment - Summary

Script Editor

Script editor allows you to write scripts for object events, functions and so on. To start  script editor for an object, invoke the right mouse popup menu by clicking the right mouse button on an object and select Script . You can also invoke script editor by clicking on the Script icon. For demonstration purpose, invoke application painter by clicking on the application icon from the Powerbar. Click on one of the Script icon or . Clicking on either of them invokes the script editor. You can see only one at any time. The first icon (left) means that there is no script for any event for the selected object. The second icon (right) means that at least one event for the selected object has the script.


Script Editor - Script Editor Popup Menu

Script editor has five DropDownListboxes by default, and you can customize them. Note that script editor also supports right mouse button's popup menu. So for things like cut & paste, you can simply use the popup menu.

The first DropDownListBox from the left is called an Events DDLB. This DDLB lists all the events available for the selected object level. The name of the event for which you are currently writing the script is shown as the heading of the script editor window. To write script for an another event, all you need to do is select the event from the Events DDLB. Selecting an option from any DDLB other than Events DDLB, would paste the selected option at the current mouse pointer position in the script editor.

The second DropDownListBox (DDLB) Paste Arguments lists all the arguments for the selected event. The third DDLB Paste Object lists all the controls and variables at that level. The Paste Global DDLB lists all the global variables and the right most DDLB Paste Instance lists all the instant variables.

icon Comments all the selected text with // comment format. icon Uncomments all the selected text with // comment format. If there are any with /*...*/ format, they will not be uncommented.

The last icon on the Painterbar represents the object for which you are writing the script. That is, if the script is for a window or a control in the window, it would be a  Window and if it is for a menu object, it would be a menu object. To close the script editor, select File/Return or click the last icon on the Painterbar; this action compiles the script and exits to the current object. You can also close the script editor  from the script editor window control box. Closing the script editor from the control panel or clicking on window close button (icon next to the window maximize icon) will prompt you for the confirmation to close the script editor. All these options do the same thing, except for the later option where you have to answer the prompt.

PowerBuilder automatically compiles the code that was open in the script editor when you close it. However, the script can be manually compiled by selecting Design/Compile Script from the menu or by clicking on the Compile toolbar button.

You can customize the script editor to suit to your tastes & needs. To customize, when in script painter select Design/Options from the menu .


Script Editor Customization Dialog box

You can choose the font for the script display in script editor from the Font tab. Script editor has the ability to maintain color codes i.e., comments in one, reserved words in another and so on. You can choose the colors from the Coloring tab. You can also specify if PowerBuilder should automatically indent the codes like If, For, While, 'Do While' and so on as you type in. This is available in the General tab.

You have learned how to start and stop PowerBuilder and customize PowerBuilder environment. In the next session, let us develop a simple application in PowerBuilder.
HomePrevious Lesson: Customizable Web links on PowerBuilder Menu
Next Lesson: PowerBuilder Environment - Summary

Copyright © 1996 - 2006 HamaraShehar.com Pvt. Ltd. All Rights Reserved.
Domain Registration, Website Design, Website Hosting by HamaraShehar.com