SheerPower® 4GL
A Guide to the SheerPower Language


Previous Contents Index

H.7 ADVANCED

Note

These advanced functions should only be used when assisting technical support with problem solution. Advanced features are not intended to be used outside of resolving technical support issues.

Table H-10 Advanced Menu
Function Description
Journal Records all mouse and keystroke movements within SPDEV. This is used for SheerPower development debugging.
View Function Usage Statistics Displays the number of times each special keystroke function has been used during the current session in SPDEV.

H.8 WINDOW

Note

Maximize All is the default setting for the window display.

Table H-11 Window Menu
Function Description
Second View View the current file inside a new window in SPDEV.
Cascade View all open files in SPDEV in smaller cascading windows.
Tile View all open files in tile format inside SPDEV.
Maximize All View all open files in maximized view. This is the default window display setting.
Arrange Icons Arranges minimized icons.
Results Window Hide or display the Results Window at the bottom of the SPDEV window. The Results Window contains the following tabs:

Find 1 and Find 2: When using the Find in Files feature (Edit-->Find in Files) you can choose which Find tab to display the results in.

Build: Displays the build status of the last .SPSRC program file run or deployed during the current session in SPDEV.

Purge: Displays the names of the backed up file versions successfully purged.

H.9 HELP

Table H-12 Help Menu
Function Description
SheerPower SPDEV Help Opens a new browser window containing links to the online SheerPower 4GL documentation and downloadable .PDF version.
Check for Updates Checks if you are running the latest version of SheerPower.
Enter License Information Copy and paste your SheerPower 4GL License Information into this dialog box.
Ordering Information Opens a new browser window containing SheerPower 4GL GOLD License purchase information.
SheerPower 4GL Home Page Opens the SheerPower 4GL website in a new browser window.
About SPDEV Displays the current version and build number of SPDEV.


Appendix I
Developing Professional Applications with SheerPower

I.1 Application Example

The purpose of this example is to illustrate the special keystrokes and other features of SheerPower Rapid Development Environment that enable a programmer to easily and quickly create professional programs.

To start SheerPower Rapid Development Environment (SPDEV), double click the SheerPower shortcut icon located on your desktop---a circle with a lightning bolt through it.

To create a new program in SheerPower Rapid Development Environment, click once on the New icon in the toolbar---a white paper with one corner folded.

Name your new program file news.spsrc and click on [SAVE]inside the Name New File... dialog box.

The Get Program info dialog box will also appear prompting you for your name, company name and program name. The program name will already be filled in for you.

When you fill in this information and click on [OK], a program template will automatically be inserted into your new program file.

Note

You can change your name and/or company name at anytime by clicking on Options in the SPDEV toolbar, then selecting Change System Settings.

You are now ready to write a professional application in SheerPower.

I.2 Program Template

A PROGRAM TEMPLATE can also be created instantly inside a program file by using the GOLD/P keystroke inside SheerPower Rapid Development Environment (SPDEV).

The GOLD Key referred to in this section is a special key used to create many of the specialized keystrokes within SPDEV. Both the [Esc] (escape key - top left corner of the keyboard) and the [Num-Lock] (numbers lock key in the numeric keypad) are GOLD keys in SheerPower Rapid Development Environment.

To use the GOLD key, press either GOLD key ([Esc] or [Num-Lock]), let go, then continue with the rest of the keystroke to complete the function.

Example I-1 Program Template

!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
! Program: Name of program 
! System : 
! Author : Your name 
! Company: Company name 
! Date   : June 30, 2002 
! Purpose: 
! 
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
 
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
!         I n i t i a l i z a t i o n 
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
 
 
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
!         M a i n   l o g i c   a r e a 
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
 
 
stop 
 
 
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
!         R o u t i n e s 
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
 
 
end 
 

Your cursor will be positioned at the top section of the template beside Purpose:. You can type in the purpose of the program being written here. The purpose of news.spsrc (this example program) is: To present the top news story from CNN.COM.

SPDEV automatically fills in the name of the program, the author and company names, and the date for you when the template is created.


!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
! Program: news 
! System : 
! Author : Your name 
! Company: Company name 
! Date   : June 30, 2002 
! Purpose: To present the top news story from CNN.COM 
! 
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

Copy and paste the following SheerPower code underneath the Initialization heading.


// Note:  From time to time CNN changes its format, so the 
//        main$  and  end_main$  sometimes have to be changed. 
 
main$ = '<div class="CNN_homeBox">' 
end_main$ = '</div>' 
 
begin_form$ = '<form>' + 
              '<h1><font color=green>' + 
              'Top News from CNN' + 
              '</font></h1>' + 
              '<br><h2>' 

Copy and paste the following code underneath the Main logic area heading above the word stop.


news_ch = _channel 
open #news_ch: name 'http://www.cnn.com' 
get_headline 

Now you are ready to write the routines that create news. spsrc.

I.3 Routine Template

Programs are made up of ROUTINES. Each routine has its own heading with details on what the purpose of the routine is, and how it works.

Creating a Routine Header Template

Place your cursor underneath the Routines heading. Press the [GOLD] key (either [Esc] or [Num-Lock]), and let go. Then press [R]. You will see the following prompt:

Type get_headline inside the empty field beside Routine Name:.

Note

All routine names must contain at least one underscore (_).

The Optional Parameters section contains the following fields:

Table I-1 Routine Template-Optional Parameters
Parameter Description
With: parameters being passed into the routine.
Returning: parameters returned as a result of running the routine.
Private: variables that can only be accessed from inside this routine.

You can leave the Optional Parameters fields blank for the purpose of this tutorial.

Note

See Section 3.5, Passing Optional Parameters to Routines for more on passing parameters in SheerPower.

Click on [OK]. The ROUTINE HEADER TEMPLATE will appear.

Example I-2 Routine Header Template

!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
! 
! Brief description: 
!   
! 
! Expected on entry: 
! 
! 
! Locals used: 
! 
! 
! Results on exit: 
! 
! 
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
routine get_headline 
 
end routine 

There are four fields to complete inside the Routine Header Template:

Here is the completed routine header for this routine:


!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
! g e t _ h e a d l i n e 
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
! 
! Brief description: 
!   Go out to www.cnn.com and extract the headline of the top 
!   news story. 
! 
! Expected on entry: 
!   main$       = the starting point of the headline 
!   begin_form$ = the top HTML code for the dialogbox form 
!   end_main$   = the end point of the headline 
! 
! Locals used: 
!   text$  = the HTML code on the CNN website 
!   crlf$  = contains the character line feeds 
!   state$ = tells which action needs to be 
!            performed next on the incoming data 
! 
! Results on exit: 
!   dbox$  = stores the code to create the dialogbox 
! 
!   The headline is found and the form is created. 
! 
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

Copy and paste the following SheerPower code into the get_headline routine on a blank line in between routine get_headline and end routine. The first line of code is indented 2 spaces under the routine statement with the rest of the code indented accordingly below.


Previous Next Contents Index