PreviousLanguage Constructs LanguagesNext

Chapter 14: Functions

This chapter describes and provides examples of REQL functions that are used to query and manage Revolve projects. Functions are designed to handle special tasks, often corresponding with features available in the Graphical User Interface. The functions that are only available to administrators in shareable projects are designated with an asterisk (*).


addComponent*

The addComponent function adds components to the active project. The component path and file name must be specified. If the component is already included in the project, it will not be added. The path and file name should not include wildcards.

Syntax:
addComponent()
Example:
To add the bms component named "intro.bms" to the
current project: 

addComponent (C:\Revolve\sample\intro.bms)

* In shareable projects this function is exclusive to the administrator.


addEntity*

The addEntity function adds an entity or database element to the REQL database. It accepts an object name and a type for that object and returns the object.

Syntax:
addEntity("entity name", type) 
Returns:

New entity added to the database.

Example:

To add a user-defined file to the Revolve database:

addEntity("PROD.MY.FILE",
type="system_data_file"); 

addExtSource*

The addExtSource function adds an extension to the project's automatic extension list. Files with the new extension are added as the specified type when automatic typing is selected.

Syntax:
addExtSource(string, type) 
Returns:

1=successful
0=error

Example:

To relate .DEC as a DEC COBOL program:

addExtSource(".DEC",type=system_component_cobol_dec); 

* In shareable projects this function is exclusive to the administrator.


addPathDb*

The addPathDb function adds a common database search path.

Syntax:
addPathDb(string) 
Returns:

1=successful
0=error

Example:

To add a common database search path:

addPathDb("c:\revolve\redb\"); 

* In shareable projects this function is exclusive to the administrator.


addPathSource*

The addPathSource function adds the specified path to the project.

Syntax:
addPathSource(string, type, [1|0]) 
Returns:

1=successful
0=error

Example:

To add a search path for COBOL components:

addPathSource("c:\revolve\sample\cobol\",
type="system_component_cobol_general"); 

* In shareable projects this function is exclusive to the administrator.


addRel

The addRel (addRelation) function adds a relationship between two entities in the database.

Syntax:
addRel(entity, relationship, entity) 
Returns:

1=successful
0=error

Example:

To relate an assignfile to a data file:

addRel(system_cobol_assign_file="PLAYMSIO",
relation="alias_for_file",
system_data_file="PROD.PLAY.MASTER"); 

Note: When adding a relation with the addRel function, both the source and destination objects must exist within the database. To create new objects use the addEntity() function.



addSearchExclusion*

The addSearchExclusion function adds a regular expression to the search exclusion list of components. Components matching any expression in the exclusion list will not be added to the project with the Automatic Component Locator.

Syntax:
addSearchExclusion(string) 
Example:

To ensure that online programs are not added to the project with the Automatic Component Locator:

addSearchExclusion("ONLINE*.CBL"); 

* In shareable projects this function is exclusive to the administrator.


addToAnnotation

The addtoAnnotation function adds the allocated sets of elements to an open annotation.

Syntax:
addToAnnotation(set) 
Returns:

1=successful
0=error

Example:

To add a set of "if" statements to the current annotation:

addToAnnotation(cobol_state_if,0); 

addTool

Adds a new tool to Tools menu.

Syntax:
addTool(toolName, toolCommand) 
Returns:

1=successful
0=error

Example:

To add a notepad to the tools menu:

addTool("notepad","C:\WINDOWS\NOTEPAD.EXE{%F}"); 

ask

The ask function initiates a prompt dialog where the user must answer yes or no in order to continue.

Syntax:
ask(string) 
Returns:

If "Yes" is chosen, 1 is returned.

If "No" is chosen, 0 is returned.

Example:
If (ask("Do you wish to continue ?")==1){..} 

atoi

The atoi function accepts a string of numbers and returns the corresponding integer representation.

Syntax:
atoi(string) 
Returns:

corresponding numbers

Example:
currentyear := atoi("1997") 

changeString*

The changestring function changes all database references from the old string to the new string. This is especially useful when source code is moved from one disk location to another and all of the internal database references to the source code must be maintained. Only available to the administrator.

Syntax:
changestring(strFrom, strTo) 
Example:
changeString("C:\REVOLVE\SOURCE\",
"R:\REVSRC\"); 

* In shareable projects this function is exclusive to the administrator.


checkMessages

The checkMessages function checks for any user-to-user messages that have been received.

Syntax:
checkmessages() 
Returns:

1=successful
0=error


checkSystem*

The checkSystem function returns as 0 if Systemwide database has been corrupted; 1 if otherwise.

Syntax:
checksystem() 
Returns:

1=successful
0=error

* In shareable projects this function is exclusive to the administrator.


chooseComponents

The chooseComponents function opens a Choose Components dialog which displays all component elements of the specified set. If an element in the set is not a component it is translated to the encompassing component.

Syntax:
chooseComponents(set) 
Returns:

Set of components selected

Example:

To allow user to select a set of cobol components:

scope:=all; 
vComponents:=chooseComponents(system_component_cobol); 

chooseElements

The chooseElements function opens a Choose dialog which displays all elements of the specified set and allows for the selection of one or more of the listed elements. When the Choose dialog is closed the selected elements are returned to their respective locations.

Syntax:
chooseElements(set) 
Returns:

Set of selected elements

Example:

To allow user to select set of files:

vFiles :=chooseElements(system_data_file); 

compile

The compile function uses the REQL script specified as an input file (.RQS) to generate a compiled output file (.RQC).

Syntax:
compile(inputFilename [ , outputFilename] );
Example:
compile("anno4.rqs", "anno5.rqc");

compress*

The compress function compresses project files.

Syntax:
compress() 

* In shareable projects this function is exclusive to the administrator.


compressComponents*

The compressComponents function compresses the specified set of components in the local databases.

Syntax:
compressComponents(set) 
Example:

To compress all COBOL programs:

scope :=all; 
compressComponents(system_component_cobol); 

* In shareable projects this function is exclusive to the administrator.


count

The count function returns the number of elements in the specified set.

Syntax:
count(set) 
Returns:

Number of elements in the specified set

Example:

To show the number of elements in a set consisting of the numbers 5 and 3:

show "The number of elements is ",count((5&3)); 

Yields:

2 

deleteRel*

The deleteRel function deletes the user relation between the specified two entities in the database.

Syntax:
deleteRel(entity from, relation, entity to|string|number)
Example:

To remove an alias from a COBOL assign file to a datafile:

deleteRel(system_cobol_assign_file="PLAYMSIO", 
relation="alias_for_file",system_data_file="PROD.PLAY. 
MASTER"); 

* In shareable projects this function is exclusive to the administrator.


div

The div function returns the quotient from the division of the first number by the second number through integer division.

Syntax:
div(number, number) 
Example:
show div(15,2); 
7 

execute

The execute function allows the user to run other executable programs from Revolve. There is no synchronization between the started program and the execute function.

Syntax:
execute("program") 
Returns:

1=successful
0=error

Example:

To start Notepad:

execute("c:\windows\notepad.exe"); 

exit

The exit function closes down Revolve.

Syntax:
exit()

exitWindows

The exitWindows function gracefully exits Revolve, any other open applications, and Windows.

Syntax:
exitWindows() 

expandComponents

The expandComponents function expands any databases which were compressed with the compressComponents function.

Syntax:
expandComponents(set) 
Example:

To expand all COBOL databases:

scope:=all; 
expandComponents(system_component_cobol); 

fieldToVar

The fieldtoVar function maps a field to its local variables within COBOL\PLI programs.

Syntax:
fieldToVar(element) 
Returns:

Set of variables relating to field.

Example:

To map selected map field to variables:

show fieldtoVar(selected); 

fixDbTime

The fixDbTime function will bring out of date database times up to date.

Syntax:
fixDbTime() 

flushStrings

The flushStrings function flushes or clears any strings which are locked in the memory.

Syntax:
flushStrings() 

funcPnt

The funcPnt function accepts entities, components, or programs and returns the results of the Function Point Analysis for those elements.

Syntax:
funcPnt(program|component) 
Example:
setFPA :=funcpnt(system_component_cobol="BATCH1");
show %25 "Type", %12 "Low", %12 "Medium", %12 "High"; 
show %25 "External Inputs", %12 setFPA[0], %12 setFPA[1], %12 setFPA[2]; 
show %25 "External Outputs", %12 setFPA[3], %12 setFPA[4], %12 setFPA[5]; 
show %25 "External Inquiries", %12 setFPA[6], %12 setFPA[7], %12 setFPA[8]; 
show %25 "ILFs", %12 setFPA[9], %12 setFPA[10], %12 setFPA[11]; 
show %25 "EIFs", %12 setFPA[12], %12 setFPA[13], %12 setFPA[14]; 
show %25 "Unused", %12 setFPA[15]; 

getDate

The getDate function returns the current date.

Syntax:
getdate() 
Example:
show getDate(); 

getEnv

The getenv function retrieves an environment variable's value.

Syntax:
getenv(string) 
Returns:

String-value of environment variable

Example:

To retrieve an environment search path:

show getenv("PATH"); 

getOption

Gets or retrieves project options.

Syntax:
getOption(string);
Example:
show getOption("PostProcessingScript"); 

getPathSource

Returns a set of strings for the search paths of the specified component or project.

Syntax:
getPathSource([UID]);
Example:
vSet :=getPathSource();
returns: searchpath*type number*scan code.

getPcbVariables

The function retrieves Pcb variable from the specified elementProgram.

Syntax:
getPcbVariables(elementProgram) 

getRelDest

The getRelDest function returns a list of all TO entities that are used by user-defined relations.

Syntax:
getRelDest() 
Example:
show getRelDest(); 

getRelDestString

The getRelDestString function returns a list of TO strings that are used by user-defined relations.

Syntax:
getRelDestString()
Example:
show getRelDestString();

getRelSrc

The getRelSrc function returns a list of all FROM entities used by user-defined relations.

Syntax:
getRelSrc() 
Example:
show getRelSrc();

getRelType

The getRelType function returns a list of all user-defined relations that exist in the database.

Syntax:
getRelType() 
Example:
show GetRelType(); 

getSearchExclusion

The getSearchExclusion function returns a list of search exclusions for the current project.

Syntax:
getSearchExclusion() 
Returns:

Set of strings

Example:
show getSearchExclusion(); 

getSelected

The getSelected function returns the set of components which have been selected in the Project Manager.

Syntax:
getSelected() 
Example:

First select a group of elements in the Project Manager by left-clicking on them with the mouse. Then in the Shell tool, type:

show getSelected(); 

getTagType

The getTagType function returns the specified annotation's type.

Syntax:
getTagType(elemAnnotation) 
Returns:

public=3

private=2

annotation not found=0


getValue

The getValue function takes a set of variables and returns a set of strings that represent values that could be contained in the variables.

Syntax:
getValue(set) 
Returns:

Set of strings

Example:

To show the possible values contained in a working storage:

show getValue(var="WS-MAIN-MENU"); 

halstead

The function halstead accepts a program or component and returns the calculated Halstead metric.

Syntax:
halstead(program|component) 
Return value type:
Set 
Example:
show halstead(system_cobol_program="BATCH1"); 

help

The help function accesses the on-line help system to provide information about various topics.

Syntax:
help("topic") 
Example:

helpIndex

The helpIndex function brings up the Help Index for Revolve.

Syntax:
helpIndex() 

impactAdd

The impactAdd function establishes the starting point for the specified impact analysis. This function is for interactive use with the Shell tool.

Syntax:
impactAdd(impact,set) 
Returns:

1=successful
0=error

Example:

To obtain the specified set of impacted elements from a COBOL variable:

scope :=all; 
vImpact :=impactNew(); 
impactAdd(vImpact, cobol_var="HDGI-DESC"); 
impactExpand(vImpact); 
show impactGetImpacted(vImpact,cobol_var="HDGI-DESC"); 
impactFree(vImpact); 

impactExpand

The impactExpand function performs impact analysis expansion on the current set of starting points within the impact. This function is for interactive use with the Shell tool.

Syntax:
impactExpand(impact) 
Returns:

1=successful
0=error

Example:

To obtain the specified set of impacted elements from a COBOL variable:

scope :=all; 
vImpact :=impactNew(); 
impactAdd(vImpact, cobol_var="HDGI-DESC"); 
impactExpand(vImpact); 
show impactGetImpacted(impact,cobol_var="HDGI-DESC"); 
impactFree(vImpact); 

impactFree

The impactFree function frees the impact created by the impactNew function. This function is for interactive use with the Shell tool.

Syntax:
impactFree(impact) 
Returns:

1=successful
0=error

Example:

To obtain the specified set of impacted elements from a COBOL variable:

scope :=all; 
vImpact :=impactNew(); 
impactAdd(vImpact, cobol_var="HDGI-DESC"); 
impactExpand(vImpact); 
show impactGetImpacted(impact,cobol_var="HDGI-DESC"); 
impactFree(vImpact); 

impactGetChain

The impactGetChain function returns the traced chain of events that resulted in an identified impact. This function is for interactive use with the Shell tool.

Syntax:
impactGetChain(impact, set, set);
Example:
show impactGetChain(vImpact, vStart, vEnd);

impactGetImpacted

The impactGetImpacted function returns the set of impacted elements from the specified set. This function is for interactive use with the Shell tool.

Syntax:
impactGetImpacted(impact, set) 
Returns:

Set of impact elements

Example:

To obtain the specified set of impacted elements from a COBOL variable:

scope :=all; 
vImpact :=impactNew(); 
impactAdd(vImpact, cobol_var="HDGI-DESC"); 
impactExpand(vImpact); 
show impactGetImpacted(impact,cobol_var="HDGI-DESC"); 
impactFree(vImpact); 

impactGetValue

The impactGetValue function generates a list of value strings that are contained in either a specified variable or any impacted variables. This function is for interactive use with the Shell tool.

Syntax:
impactGetValue(set [,level]) 
Returns:

Set of Values

Example:

To show the possible value of a COBOL variable:

scope:=all; 
show impactGetValue(cobol_var="HDG2-DESC"); 

impactLoad

The impactLoad function loads an impact object from a file saved with the impactSave function. This function is for interactive use with the Shell tool.

Syntax:
impactLoad(string) 
Returns:

Impact Object

Example:
vImpact:=impactNew(); 
impactAdd(vImpact, cobol_var="HDGI-DESC"); 
impactExpand(vImpact); 
impactSave(vImpact, C:\impact.sav"); 
impactFree(vImpact); 
vImpact2:=impactLoad("C:\impact.sav"); 
show impact Get Impacted(vImpacted, cobol_var="HDGI-DESC"); 
impactFree(vImpact2); 

impactNew

The impactNew function creates a new impact analysis object. This function is for interactive use with the Shell tool.

Syntax:
impactNew() 
Example:

To obtain the specified set of impacted elements from a COBOL variable:

scope :=all; 
vImpact :=impactNew(); 
impactAdd(vImpact, cobol_var="HDGI-DESC"); 
impactExpand(vImpact); 
show impactGetImpacted(impact,cobol_var="HDGI-DESC"); 
impactFree(vImpact); 

impactSave

The impactSave function saves the impact analysis object to file. The file is available for later use and can be reloaded with the impactLoad function. This function is for interactive use with the Shell tool.

Syntax:
impactSave(impact,string) 
Returns:

Impact object

Example:
vImpact:=impactNew(); 
impactAdd(vImpact, cobol_var="HDGI-DESC"); 
impactExpand(vImpact); 
impactSave(vImpact, C:\impact.sav"); 
impactFree(vImpact); 
vImpact2:=impactLoad("C:\impact.sav") 
show impact Get Impacted(vImpacted, cobol_var="HDGI-DESC"); 
impactFree(vImpact2); 

impactWalk

The impactWalk function generates a list of variables that are impacted by the passed variable. This function is for interactive use with the Shell tool.

Syntax:
impactWalk(set[,level]) 
Returns:

Set of impacted elements

Example:

To show impacts for a COBOL variable:

scope:=all; 
show impactWalk(cobol_var="ws-sales-read"); 

impactWalkProgram

The impactWalkProgram generates a list of variables that are impacted within a specified program. This function is for interactive use with the Shell tool.

Syntax:
impactWalkProgram(set[,level]) 
Returns:

Set of impacted variables

Example:

To show a list of variables that are impacted within a COBOL program:

scope:=all; 
show impactWalk Program (cobol_var="ws-sales-read"); 

informationBox

The informationBox function opens the Browser that corresponds to the specified element.

Syntax:
informationBox(element) 
Returns:

1=successful

0=error

Example:

To bring up a Browser for a data file:

scope:=all; 
informationBox(system_data_file="PROD.GAME.MASTER"); 

integrate*

The integrate function initiates the system wide phase (phase 7) of the Parsing process.

Syntax:
integrate() 

* In shareable projects this function is exclusive to the administrator.


invoke

The invoke function loads and executes a file of REQL commands known as a script.

Syntax:
invoke(filename) 
Returns:

1=successful
0=error

Example:

To run a REQL script that checks indentation:

invoke("c:\revolve\script\standard\indent.rqs"); 

isAdmin

The isAdmin function indicates that the user has administrator access to the project.

Syntax:
isAdmin() 
Returns:

1=successful
0=error

Example:

In Administrator mode:

if (isAdmin()) 
show "I am the administrator!"; 

isShareable

The isSharable function indicates whether the project is sharable or single-user.

Syntax:
isShareable() 
Returns:

1=current project is shareable

0=current project is single-user

Example:
if (! isShareable()) 
show "Single-user project"; 

itoa

The function itoa accepts a number and returns the corresponding character value.

Syntax:
itoa(number) 
Returns:

String

Example:
strcurrentyear:=(itoa (1997)); 
show strcurrentyear; 

loadSetFromFile

The loadSetFromFile function returns the REQL set stored in the specified file.

Syntax:
loadSetFromFile(strfilename);

lockUID

The lockUID function locks the annotation for modification through the addRel function. An annotation must be locked to in order to add or remove elements and descriptions. An error can occur if the annotation has been locked by another user.

Syntax:
lockUID(UID) 
Example:

To create a new annotation and add a connected paragraph:

scope:=all; 
vAnnotation:=addEntity("My Annotation, type="user_annotation"); 
lockUID(vAnnotation); 
addRel(vAnnotation, relation="hasa_user_connectedto", cobol_label_para="END-FILE-BROWSE"); 
unlockUID(vAnnotation); 

logError

The logError function logs an error message to the Revolve error log file.

Syntax:
logError(string) 
Returns:

1=successful
0=error

Example:

To log an error message to the error log file (c:\revolve.log):

logError ("This is an error!"); 

make*

The make function checks the status of each component in the project. If any of the components have an updated status of anything other than "Loaded," then those components are parsed and/or loaded depending on their new status. This command is used to bring all components in the database up to date. Only available to the administrator.

Syntax:
make() 
Returns:

1=successful
0=error

Example:
make(); 

* In shareable projects this function is exclusive to the administrator.


makeAdmin

The makeAdmin function puts the current database in Administrative mode. Administrative mode provides such Revolve functionality as parsing, adding/deleting components, and completing the project.

Syntax:
makeAdmin() 
Returns:

1=successful
0=error

Example:
if (!isAdmin()); 
makeAdmin(); 

makeSelected*

The makeSelected function performs the make operation on the specified items in the scope.

Syntax:
makeSelected() 
Example:

To perform a make on all COBOL programs:

scope:=all; 
scope:=system_component_cobol; 
makeselected(); 

* In shareable projects this function is exclusive to the administrator.


makeTagLocal

The makeTagLocal function moves a public annotation to the private annotation directory.

Syntax:
makeTagLocal(elemAnnotation) 
Returns:

1=successful
0=error

Example:
/*see lockUID to create an annotation*/ 
makeTagLocal(vAnnotation); 

makeUser

The makeUser function switches the operation of Revolve from Administrator to User. This function disables Revolve features that are reserved for the Administrator. The makeUser option is only available in the Administrator mode only.

Syntax:
makeUser() 
Returns:

1=successful
0=error

Example:

To change from Administrator to User:

if(isAdmin()) 
makeUser(); 

mccabe

The mccabe function accepts a program or component and returns the calculated McCabe metric.

Syntax:
mccabe(program|component) 
Return value type:

set

Example:
show mccabe(system_cobol_program="BATCH1"); 

mcclure

The mcclure function accepts a program or component and returns the calculated McClure metric.

Syntax:
mcclure(program|component) 
Return value type:

Set

Example:
show mcclure(system_cobol_program="BATCH1"); 

memWalk

The memWalk function is an internal debugging command. String signifies the file and directory where results will be stored. The numbers represent the level of debugging information that is displayed. The second parameter uses 0,1, and 2. 0 being the lowest level of information and 2 indicating the most. The third parameter should always be set to 0. After using the memWalk function go to the text file in the specified directory to view the results.

Syntax:
memWalk(string,number,number) 
Example:
scope:=all; 
memWalk("c:\test\temp1.txt",1,0); 

mult

The mult function performs integer multiplication. The syntax allows the multiplication of two numbers separated by a comma.

Syntax:
mult(number,number) 
Returns:

integer

Example:
show mult(5,6); 

offSetInto

The offSetInto function returns the set of variables that are children of one of the specified variables and are the smallest to contain all the bytes at the specified offset.

Syntax:
offSetInto(set, location, size) 
Example:
show red offSetInto(var="XDR-RECORD-LOAD",120,8); 

oneProgramImpact

The oneProgramImpact performs an impact analysis on the specified element through one program.

Syntax:
oneProgramImpact(element for Impact) 
Example:
scope:=all; 
show oneProgramImpact(var="VB01-GAME-NO"); 

parse*

The parse function parses (or reparses) all components in the scope. After a parse, the command "show err" can be used to list the errors and warnings that were generated. A long parse can be stopped by clicking the stop icon on the status bar.

Syntax:
parse() 
Returns:

None

Example:

To parse all of the components in the project:

scope:=all;
parse();

* In shareable projects this function is exclusive to the administrator.


pause

The pause function invokes a Windows dialog box with the prompt and waits for the user to continue.

Syntax:
pause(string) 
Returns:

1=successful
0=error

Example:

To display the pause dialog box :

pause("Press ok to continue"); 

postCommandAll*

The postCommandAll function posts a REQL command to all users of Revolve. The parameter option "numDays" determines the expiration date for the command.

Syntax:
postCommandAll(string[,numDays]) 
Returns:

Message id of command

Example:

To say hello to everybody:

postCommandAll("open report; 
show /"HELLO EVERYBODY/""); 

* In shareable projects this function is exclusive to the administrator.


postCommandProject*

The postCommandProject function posts a REQL command to all users of current project.

Syntax:
postCommandProject(string[,numDays] ) 
Returns:

Message id command

Example:

To say hello to project users:

postCommandProject("open report; 
show /"Hello Project Users/";"); 

* In shareable projects this function is exclusive to the administrator.


postMessageAll

The postMessageAll function posts a message to all Revolve users.

Syntax:
postMessageAll(string) 
Returns:

Message id

Example:
postMessageAll("Hello World!"); 

postMessageProject

The postMessageProject function posts a message to all users of the current project.

Syntax:
postMessageProject(string) 
Returns:

Message id

Example:
postMessageProject("Hello Project Users!"); 

postTag

The postTag function moves a private annotation to public.

Syntax:
postTag(elemAnnotation) 
Returns:

1=successful
0=error


printf

Function printf accepts a format string and a list of arguments and displays the formatted string converted to include the argument list.

Syntax:
printf(format string [, argument [,argument ...]] ) 

Similar to the "C" printf function, the format string may include specification characters which are used to translate the arguments in the argument list to the correct types for printing.

Each conversion specification begins with a "%" and is immediately followed by a conversion specification character.

Specification Description

S String of characters

D,I Integer

Return value type:

None

Example:

To display a sample string:

titlestr := "current year:"
currentyear := 1997 
printf ("The %s is %d", titlestr, currentyear); 

processEntity*

The processEntity function adds a system-wide object to the database with the name of the string and type passed. Links object to component, so that when the component is removed or reparsed the object will be destroyed. Optional uid parent specifies the system-wide parent of the object.

Syntax:
processEntity(string,type,component [,uidParent]) 
Returns:

Newly created object

* In shareable projects this function is exclusive to the administrator.


processRel*

The processRel function adds a system-wide relation between elemfrom and elements which will be removed if either object is removed (through reparse/component delete).

Syntax:
processRel(elemFrom,relation,elemTo|string|number ) 
Returns:

1=successful
0=error

* In shareable projects this function is exclusive to the administrator.


projectAddDirectory*

The projectAddDirectory function adds any components that match the strFileSpec within strPath directory. The third parameter "1|0" indicates whether subdirectories should be added. "1" indicates that subdirectories should be added; "0" indicates that subdirectories should not be added.

Syntax:
projectAddDirectory(strPath,strFileSpec,1|0 ) 
Returns:

1=successful
0=error

Example:

To add COBOL source to a project:

projectAddDirectory("c:\revolve\sample\cobol","*CBL",0);

* In shareable projects this function is exclusive to the administrator.


projectClose

The projectClose function closes the open Revolve project.

Syntax:
projectClose() 
Returns:

1=successful
0=error

Example:

To open a project, perform a make, and close:

projectOpen(C:\REVOLVE\REDB\SAMPLE.PRJ."); 
make(); 
projectClose(); 

projectDelete*

The REQL function projectDelete(0|1|2) enables you to delete areas of the current project. A parameter value of zero displays the same prompt as if this option were chosen from the Project menu. A value of 1 deletes the project files, but leaves the component databases. A value of 2 deletes both the project files and component databases.

Syntax:
projectDelete(0|1|2);

* In shareable projects this function is exclusive to the administrator.


projectMakeShareable*

The projectMakeShareable function builds a shadow project (.sha) in the file that is specified in the strPath parameter.

Syntax:
projectMakeShareable(strPath) 
Example:
projectMakeShareable("c:\database\shadow"); 

* In shareable projects this function is exclusive to the administrator.


projectNew

The projectNew function creates a new project using the specified path and name.

Syntax:
projectNew(string) 
Returns:

1=successful
0=error

Example:
projectNew("C:\DATABASE\SAMPLE.PRJ"); 

projectOpen

The projectOpen function opens the specified project.

Syntax:
projectOpen(string) 
Returns:

1=successful
0=error

Example:

To open a project, perform a make, and close:

projectOpen(C:\REVOLVE\REDB\SAMPLE.PRJ."); 
make(); 
projectClose(); 

projectRemoveComps*

The projectRemoveComps function removes components contained in setComp from the project. The optional second parameter indicates if the database files should be deleted (default is 1).

Syntax:
projectRemoveComps(setComp[,1|0]) 
Returns:

1=successful
0=error

Example:

To delete all BMS components:

scope:=all; 
projectRemoveComps(system_component_bms); 

* In shareable projects this function is exclusive to the administrator.


prompt

The prompt function displays the specified prompt and assigns the user variable with the results.

Syntax:
prompt("prompt", "user variable") 
Returns:

Number

If "OK" is chosen, 1 is returned

If "CANCEL" is chosen, 0 is returned

Example:

To prompt for a drive specification:

prompt("Enter Drive:","vDrive"); 

rebuildRl*

The rebuildRl function reconstructs the label index.

Syntax:
rebuildRl() 
Example:
rebuildRl(); 

* In shareable projects this function is exclusive to the administrator.


rebuildRt*

The rebuildRt function reconstructs the literal index.

Syntax:
rebuildRt() 
Example:
reuildRt(); 

* In shareable projects this function is exclusive to the administrator.


rebuildRv*

The rebuildRv reconstructs the variable index.

Syntax:
rebuildRv() 
Example:
rebuildRv(); 

* In shareable projects this function is exclusive to the administrator.


reintegrate*

The reintegrate function is used to reintegrate databases of the components in scope.

Syntax:
reintegrate() 
Example:
reintegrate(); 

* In shareable projects this function is exclusive to the administrator.


removeMessage

The removeMessage function removes a message from the messaging system.

Syntax:
removeMessage(messageID) 
Returns:

1=successful
0=error

Example:

To post a temporary message during processing:

vMessage:=postMessageProject("Processing..."); 
removeMessage(vMessage); 

removeSearchExclusion*

The removeSearchExclusion function removes an entry from the search exclusion list.

Syntax:
removeSearchExclusion(index) 
Returns:

1=successful
0=error

Example:
removeSearchExclusion(0); 

* In shareable projects this function is exclusive to the administrator.


return

The return function returns the flow of control from a REQL script.

Syntax:
return() 
Returns:

None

Example:

To return at the end of a script:

return(); 

saveSetToFile

Writes the contents of a REQL set to the specified filename. The set can then be reloaded with the loadSetFromFile function

Syntax:
saveSetToFile(set, strFileName);

scopeUid

The scopeUID function sets the scope as a specified annotation so the relations that are added will be added to that annotation.

Syntax:
scopeUid(UID) 
Example:

To add element description to annotation element:

vAnnotation:=addEntity("My Annotation",type="user-annotation"); 
Lockuid(vAnnotation); 
Scopeuid(vAnnotation); 
addRelation(vAnnotation, relation="hasa_user_connectedTo", cobol_label_para="READ-FILE-MAIL-EXIT"); 
addRelation(cobol_label_para="dr",
relation="attr_user_description", "Element Description."); 
unlockuid(vAnnotation); 

segregate*

The segregate function segregates system-wide database information for all loaded items in scope.

Syntax:
segregate() 
Returns:

1=successful
0=error

* In shareable projects this function is exclusive to the administrator.


setFind

The SetFind option determines if the specified element is within the specified set.

Syntax:
setFind(set,element) 
Returns:

If a non-negative number is returned, the element has been found in the set at the specified index.

Example:
scope:=all; 
vSetVars:=cobol_var; 
showVsetVars; 

Select an element by right-clicking on it with the mouse and choosing Select from the speed menu. Its name appears at the bottom of the Shell tool and the Desktop.

show setFind(vSetVars, selected); 

setInteractiveMode

The setInteractiveMode function turns interactive mode on/off. When interactive mode is off the user is not prompted with confirmation message boxes.

Syntax:
setInteractiveMode(0|1) 
Returns:

1=successful
0=error

Example:
show setInteractiveMode(1); 

setOption*

The setOption function sets the specified strOption to the specified value or turns the option on/off. The following options are available:

Syntax:
setOption(strOption,1|0 or string value) 
Returns:

1=successful
0=error

Example:
setOption("EnableACL", 0); 
setOption("PublicAnnotationDir","c:\");

* In shareable projects this function is exclusive to the administrator.


shellLoadFromFile

The shellLoadFromFile function loads the specified text file into the current shell or report.

Syntax:
 shellLoadFromFile(strFileName) 
Returns:

1=successful
0=error

Example:
open report; 
scope:=all; 
show cobol_var="*DATE*"; 
shellSaveToFile("c:\output.txt"); 
close report; 
//new report// 
open report; 
shellLoadFromFile("c:\outout.txt"); 
shellprint(); 

shellPrint

The shellPrint function displays a Print dialog.

Syntax:
shellPrint() 
Returns:

1=successful
0=error


shellSaveToFile

The shellSaveToFile function saves current report or shell to the text file specified in the strFileName parameter.

Syntax:
shellSaveToFile(strFileName) 
Returns:

1=successful
0=error


shellSetTitle

The shellSetTitle function gives the current report or shell the title that is specified in the string parameter.

Syntax:
shellSetTitle(string) 
Example:
open report; 
shellSetTitle("DATE IMPACT REPORT"); 

showFunctions

The showFunctions function displays a list of all available functions. Functions that are exclusive to a project administrator are preceded with (admin). If the function is preceded with (dev), then it is only for interactive use with the Shell tool.

Syntax:
showFunctions([string]) 
Example:
showFunctions("s*"); 

Returns all functions that begin with s.


showVars

Shows the currently defined REQL variables.

Syntax:
showVars([string]);
Example:
showVars("

sort

The sort function is used to sort a set of elements. The criteria for the sort can be specified in REQL following the by keyword. If the by clause is left out, then the elements in the set are sorted by their location in the program.

Syntax:
sort(set)
sort(uservar <: set by REQL statement that returns an attribute) 
Returns:

Set of sorted elements

Example:

To sort paragraphs into their location order:

To sort variables into size order, with the smallest first:


sprintf

Function sprintf writes formatted output to a string.

Syntax:
sprintf(strFormat[,argument...]) 
Example:
strvar:=sprintf 
show sprintf("%I %S", 3456, "Fred"); 

status*

The status function performs status updates on all components in the loaded project.

Syntax:
status() 
Example:
status(); 

* In shareable projects this function is exclusive to the administrator.


strconcat

Function strconcat accepts two strings or variables containing strings and returns a string with the second concatenated onto the end of the first.

Syntax:
strconcat(string,string) 
Returns:

string

Example:
firstname := "John"; 
fullname := strconcat(firstname,"Doe"); 
show fullname; 

strcopy

Function strcopy copies the specified string to the specified variable.

Syntax:
strcopy(variable,string) 
Returns:

strcopy returns dest.

Example:
newvar:=""; 
strcopy(newvar, "John"); 

strlen

Function strlen accepts one string and returns a number representing the length of the string.

Syntax:
strlen(string) 
Returns:

Number

Example:

To assign the length of a path to a variable:

namelength:=strlen("c:\revolve\bin\revolve.exe"); 

strscan

The strscan function returns index of string2 specified within string1.

Syntax:
strscan(string1,string2) 
Example:
show strscan("cats and dogs", "dogs"); 

substr

The substr function takes a string and returns a substring. First is the number of the first character in the substring and length is its length. The first character in the string has the character location 0. If length is equal to 1, substr returns a single character. The substring is truncated if first+length is greater than the length of the string.

Syntax:
substr(string, first, length) 
Returns:

String

Example:

To show the first four characters of the name of the selected
element:

show substr(selected:>attr_name, 0, 4); 

To show the second character of the selected element:

show substr(selected:>attr_name, 1, 1); 

sum

The sum function returns the sum of the set of integers.

Syntax:
sum(set) 
Returns:

Number

Example:

To show the total:

show "The total of the set is" ,sum((5&3)); 
8 

To show the number of lines in a component:

show "The total of number of lines is
",sum(component:>lines); 

timer

The timer function displays the current time down to hundreths of a second, as well as the elapsed time since the previous timer call.

Syntax:
timer()
Example:
show timer();
vcount:=count(COBOL_STATE);
show timer(); 

timerKill

For information on this function refer to the timerUpdate function.


timerUpdate

The timerUpdate function initiates and establishes parameters for a progress bar. The first time this function is called, a new progress bar will be invoked. All subsequent calls will update the parameters and the status will be displayed as a progress bar. The "title" string specifies the title of the window. The status string designates the component that is being processed. The i specifies the current position of the progress bar where n indicates the maximum number of position. In order to close a progress there must be a call to timerKill.

Syntax:
timerUpdate("title", "status string", i
# of current, n # of total steps) 
Example:
scope :=all; 
vCount:=0 
vTotal:=count(component_cobol); 
for vComp<: component_cobol{ 
 vProgramName :=vComp:.attr_reql_name; 
 timerUpdate("Example Process Monitor", vProgramName, vCount, vTotal); 
------------------- 
There will be a process for each COBOL program. 
------------------- 
} 
timerKill(); 

translate*

The translate command adds the specified import translation to the current project.

Syntax:
translate"from" "to" 
Example:
scope :=all; 
translate "test" testing" 

* In shareable projects this function is exclusive to the administrator.


uniquify

The uniquify function removes duplicated elements from the specified set.

Syntax:
uniquify(set) 
Returns:

Set

Example:

To uniquify a set of names which contains strings:

names:=uniquify(names); 

unlockUID

The unlockUID function unlocks an annotation following an update.

Syntax:
unlockUID(annotation UID) 
Example:

To create a new annotation and unlock it for use.

scope:=all; 

vAnnotation:=addEntity("My Annotation,
type="user_annotation"); 

lockUID(vAnnotation); 

addRel(vAnnotation, relation="hasa_user_connectedto",
cobol_label_para="END-FILE-BROWSE"); 

unlockUID(vAnnotation); 

unused

The unused function takes a set of labels or statements and returns the subset which is never used.

Syntax:
unused(set) 
Returns:
Set of labels or statements 
Example:

To show the CICS statements which are never used:

show yellow unused(cics_state); 

updateShared*

The updateshared function updates the shareable database from a shadow project.

Syntax:
updateShared() 
Returns:

1=successful
0=error

Example:
makeAdmin(); 
updateshared(); 

* In shareable projects this function is exclusive to the administrator.


varToField

The varToField function maps a set of variables to related BMS/MFS fields.

Syntax:
varToField(set) 
Returns:

Set of elements.

Example:
scope:=all; 
show varToField(cobol_var="HBVRIFY-USER-NO-I"); 


Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.
PreviousLanguage Constructs LanguagesNext