Language Constructs | Languages |
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 (*).
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.
addComponent()
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.
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.
addEntity("entity name", type)
New entity added to the database.
To add a user-defined file to the Revolve database:
addEntity("PROD.MY.FILE", type="system_data_file");
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.
addExtSource(string, type)
1=successful
0=error
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.
The addPathDb function adds a common database search path.
addPathDb(string)
1=successful
0=error
To add a common database search path:
addPathDb("c:\revolve\redb\");
* In shareable projects this function is exclusive to the administrator.
The addPathSource function adds the specified path to the project.
addPathSource(string, type, [1|0])
1=successful
0=error
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.
The addRel (addRelation) function adds a relationship between two entities in the database.
addRel(entity, relationship, entity)
1=successful
0=error
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.
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.
addSearchExclusion(string)
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.
The addtoAnnotation function adds the allocated sets of elements to an open annotation.
addToAnnotation(set)
1=successful
0=error
To add a set of "if" statements to the current annotation:
addToAnnotation(cobol_state_if,0);
Adds a new tool to Tools menu.
addTool(toolName, toolCommand)
1=successful
0=error
To add a notepad to the tools menu:
addTool("notepad","C:\WINDOWS\NOTEPAD.EXE{%F}");
The ask function initiates a prompt dialog where the user must answer yes or no in order to continue.
ask(string)
If "Yes" is chosen, 1 is returned.
If "No" is chosen, 0 is returned.
If (ask("Do you wish to continue ?")==1){..}
The atoi function accepts a string of numbers and returns the corresponding integer representation.
atoi(string)
corresponding numbers
currentyear := atoi("1997")
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.
changestring(strFrom, strTo)
changeString("C:\REVOLVE\SOURCE\", "R:\REVSRC\");
* In shareable projects this function is exclusive to the administrator.
The checkMessages function checks for any user-to-user messages that have been received.
checkmessages()
1=successful
0=error
The checkSystem function returns as 0 if Systemwide database has been corrupted; 1 if otherwise.
checksystem()
1=successful
0=error
* In shareable projects this function is exclusive to the administrator.
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.
chooseComponents(set)
Set of components selected
To allow user to select a set of cobol components:
scope:=all; vComponents:=chooseComponents(system_component_cobol);
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.
chooseElements(set)
Set of selected elements
To allow user to select set of files:
vFiles :=chooseElements(system_data_file);
The compile function uses the REQL script specified as an input file (.RQS) to generate a compiled output file (.RQC).
compile(inputFilename [ , outputFilename] );
compile("anno4.rqs", "anno5.rqc");
The compress function compresses project files.
compress()
* In shareable projects this function is exclusive to the administrator.
The compressComponents function compresses the specified set of components in the local databases.
compressComponents(set)
To compress all COBOL programs:
scope :=all; compressComponents(system_component_cobol);
* In shareable projects this function is exclusive to the administrator.
The count function returns the number of elements in the specified set.
count(set)
Number of elements in the specified set
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
The deleteRel function deletes the user relation between the specified two entities in the database.
deleteRel(entity from, relation, entity to|string|number)
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.
The div function returns the quotient from the division of the first number by the second number through integer division.
div(number, number)
show div(15,2); 7
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.
execute("program")
1=successful
0=error
To start Notepad:
execute("c:\windows\notepad.exe");
The exit function closes down Revolve.
exit()
The exitWindows function gracefully exits Revolve, any other open applications, and Windows.
exitWindows()
The expandComponents function expands any databases which were compressed with the compressComponents function.
expandComponents(set)
To expand all COBOL databases:
scope:=all; expandComponents(system_component_cobol);
The fieldtoVar function maps a field to its local variables within COBOL\PLI programs.
fieldToVar(element)
Set of variables relating to field.
To map selected map field to variables:
show fieldtoVar(selected);
The fixDbTime function will bring out of date database times up to date.
fixDbTime()
The flushStrings function flushes or clears any strings which are locked in the memory.
flushStrings()
The funcPnt function accepts entities, components, or programs and returns the results of the Function Point Analysis for those elements.
funcPnt(program|component)
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];
The getDate function returns the current date.
getdate()
show getDate();
The getenv function retrieves an environment variable's value.
getenv(string)
String-value of environment variable
To retrieve an environment search path:
show getenv("PATH");
Gets or retrieves project options.
getOption(string);
show getOption("PostProcessingScript");
Returns a set of strings for the search paths of the specified component or project.
getPathSource([UID]);
vSet :=getPathSource(); returns: searchpath*type number*scan code.
The function retrieves Pcb variable from the specified elementProgram.
getPcbVariables(elementProgram)
The getRelDest function returns a list of all TO entities that are used by user-defined relations.
getRelDest()
show getRelDest();
The getRelDestString function returns a list of TO strings that are used by user-defined relations.
getRelDestString()
show getRelDestString();
The getRelSrc function returns a list of all FROM entities used by user-defined relations.
getRelSrc()
show getRelSrc();
The getRelType function returns a list of all user-defined relations that exist in the database.
getRelType()
show GetRelType();
The getSearchExclusion function returns a list of search exclusions for the current project.
getSearchExclusion()
Set of strings
show getSearchExclusion();
The getSelected function returns the set of components which have been selected in the Project Manager.
getSelected()
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();
The getTagType function returns the specified annotation's type.
getTagType(elemAnnotation)
public=3
private=2
annotation not found=0
The getValue function takes a set of variables and returns a set of strings that represent values that could be contained in the variables.
getValue(set)
Set of strings
To show the possible values contained in a working storage:
show getValue(var="WS-MAIN-MENU");
The function halstead accepts a program or component and returns the calculated Halstead metric.
halstead(program|component)
Set
show halstead(system_cobol_program="BATCH1");
The help function accesses the on-line help system to provide information about various topics.
help("topic")
help("shell");
help("source view");
help("sour");
The helpIndex function brings up the Help Index for Revolve.
helpIndex()
The impactAdd function establishes the starting point for the specified impact analysis. This function is for interactive use with the Shell tool.
impactAdd(impact,set)
1=successful
0=error
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);
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.
impactExpand(impact)
1=successful
0=error
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);
The impactFree function frees the impact created by the impactNew function. This function is for interactive use with the Shell tool.
impactFree(impact)
1=successful
0=error
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);
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.
impactGetChain(impact, set, set);
show impactGetChain(vImpact, vStart, vEnd);
The impactGetImpacted function returns the set of impacted elements from the specified set. This function is for interactive use with the Shell tool.
impactGetImpacted(impact, set)
Set of impact elements
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);
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.
impactGetValue(set [,level])
Set of Values
To show the possible value of a COBOL variable:
scope:=all; show impactGetValue(cobol_var="HDG2-DESC");
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.
impactLoad(string)
Impact Object
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);
The impactNew function creates a new impact analysis object. This function is for interactive use with the Shell tool.
impactNew()
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);
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.
impactSave(impact,string)
Impact object
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);
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.
impactWalk(set[,level])
Set of impacted elements
To show impacts for a COBOL variable:
scope:=all; show impactWalk(cobol_var="ws-sales-read");
The impactWalkProgram generates a list of variables that are impacted within a specified program. This function is for interactive use with the Shell tool.
impactWalkProgram(set[,level])
Set of impacted variables
To show a list of variables that are impacted within a COBOL program:
scope:=all; show impactWalk Program (cobol_var="ws-sales-read");
The informationBox function opens the Browser that corresponds to the specified element.
informationBox(element)
1=successful
0=error
To bring up a Browser for a data file:
scope:=all; informationBox(system_data_file="PROD.GAME.MASTER");
The integrate function initiates the system wide phase (phase 7) of the Parsing process.
integrate()
* In shareable projects this function is exclusive to the administrator.
The invoke function loads and executes a file of REQL commands known as a script.
invoke(filename)
1=successful
0=error
To run a REQL script that checks indentation:
invoke("c:\revolve\script\standard\indent.rqs");
The isAdmin function indicates that the user has administrator access to the project.
isAdmin()
1=successful
0=error
In Administrator mode:
if (isAdmin()) show "I am the administrator!";
The isSharable function indicates whether the project is sharable or single-user.
isShareable()
1=current project is shareable
0=current project is single-user
if (! isShareable()) show "Single-user project";
The function itoa accepts a number and returns the corresponding character value.
itoa(number)
String
strcurrentyear:=(itoa (1997)); show strcurrentyear;
The loadSetFromFile function returns the REQL set stored in the specified file.
loadSetFromFile(strfilename);
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.
lockUID(UID)
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);
The logError function logs an error message to the Revolve error log file.
logError(string)
1=successful
0=error
To log an error message to the error log file (c:\revolve.log):
logError ("This is an error!");
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.
make()
1=successful
0=error
make();
* In shareable projects this function is exclusive to the administrator.
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.
makeAdmin()
1=successful
0=error
if (!isAdmin()); makeAdmin();
The makeSelected function performs the make operation on the specified items in the scope.
makeSelected()
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.
The makeTagLocal function moves a public annotation to the private annotation directory.
makeTagLocal(elemAnnotation)
1=successful
0=error
/*see lockUID to create an annotation*/ makeTagLocal(vAnnotation);
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.
makeUser()
1=successful
0=error
To change from Administrator to User:
if(isAdmin()) makeUser();
The mccabe function accepts a program or component and returns the calculated McCabe metric.
mccabe(program|component)
set
show mccabe(system_cobol_program="BATCH1");
The mcclure function accepts a program or component and returns the calculated McClure metric.
mcclure(program|component)
Set
show mcclure(system_cobol_program="BATCH1");
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.
memWalk(string,number,number)
scope:=all; memWalk("c:\test\temp1.txt",1,0);
The mult function performs integer multiplication. The syntax allows the multiplication of two numbers separated by a comma.
mult(number,number)
integer
show mult(5,6);
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.
offSetInto(set, location, size)
show red offSetInto(var="XDR-RECORD-LOAD",120,8);
The oneProgramImpact performs an impact analysis on the specified element through one program.
oneProgramImpact(element for Impact)
scope:=all; show oneProgramImpact(var="VB01-GAME-NO");
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.
parse()
None
To parse all of the components in the project:
scope:=all;
parse();
* In shareable projects this function is exclusive to the administrator.
The pause function invokes a Windows dialog box with the prompt and waits for the user to continue.
pause(string)
1=successful
0=error
To display the pause dialog box :
pause("Press ok to continue");
The postCommandAll function posts a REQL command to all users of Revolve. The parameter option "numDays" determines the expiration date for the command.
postCommandAll(string[,numDays])
Message id of command
To say hello to everybody:
postCommandAll("open report; show /"HELLO EVERYBODY/"");
* In shareable projects this function is exclusive to the administrator.
The postCommandProject function posts a REQL command to all users of current project.
postCommandProject(string[,numDays] )
Message id command
To say hello to project users:
postCommandProject("open report; show /"Hello Project Users/";");
* In shareable projects this function is exclusive to the administrator.
The postMessageAll function posts a message to all Revolve users.
postMessageAll(string)
Message id
postMessageAll("Hello World!");
The postMessageProject function posts a message to all users of the current project.
postMessageProject(string)
Message id
postMessageProject("Hello Project Users!");
The postTag function moves a private annotation to public.
postTag(elemAnnotation)
1=successful
0=error
Function printf accepts a format string and a list of arguments and displays the formatted string converted to include the argument list.
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.
S String of characters
D,I Integer
None
To display a sample string:
titlestr := "current year:" currentyear := 1997 printf ("The %s is %d", titlestr, currentyear);
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.
processEntity(string,type,component [,uidParent])
Newly created object
* In shareable projects this function is exclusive to the administrator.
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).
processRel(elemFrom,relation,elemTo|string|number )
1=successful
0=error
* In shareable projects this function is exclusive to the administrator.
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.
projectAddDirectory(strPath,strFileSpec,1|0 )
1=successful
0=error
To add COBOL source to a project:
projectAddDirectory("c:\revolve\sample\cobol","*CBL",0);
* In shareable projects this function is exclusive to the administrator.
The projectClose function closes the open Revolve project.
projectClose()
1=successful
0=error
To open a project, perform a make, and close:
projectOpen(C:\REVOLVE\REDB\SAMPLE.PRJ."); make(); projectClose();
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.
projectDelete(0|1|2);
* In shareable projects this function is exclusive to the administrator.
The projectMakeShareable function builds a shadow project (.sha) in the file that is specified in the strPath parameter.
projectMakeShareable(strPath)
projectMakeShareable("c:\database\shadow");
* In shareable projects this function is exclusive to the administrator.
The projectNew function creates a new project using the specified path and name.
projectNew(string)
1=successful
0=error
projectNew("C:\DATABASE\SAMPLE.PRJ");
The projectOpen function opens the specified project.
projectOpen(string)
1=successful
0=error
To open a project, perform a make, and close:
projectOpen(C:\REVOLVE\REDB\SAMPLE.PRJ."); make(); projectClose();
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).
projectRemoveComps(setComp[,1|0])
1=successful
0=error
To delete all BMS components:
scope:=all; projectRemoveComps(system_component_bms);
* In shareable projects this function is exclusive to the administrator.
The prompt function displays the specified prompt and assigns the user variable with the results.
prompt("prompt", "user variable")
Number
If "OK" is chosen, 1 is returned
If "CANCEL" is chosen, 0 is returned
To prompt for a drive specification:
prompt("Enter Drive:","vDrive");
The rebuildRl function reconstructs the label index.
rebuildRl()
rebuildRl();
* In shareable projects this function is exclusive to the administrator.
The rebuildRt function reconstructs the literal index.
rebuildRt()
reuildRt();
* In shareable projects this function is exclusive to the administrator.
The rebuildRv reconstructs the variable index.
rebuildRv()
rebuildRv();
* In shareable projects this function is exclusive to the administrator.
The reintegrate function is used to reintegrate databases of the components in scope.
reintegrate()
reintegrate();
* In shareable projects this function is exclusive to the administrator.
The removeMessage function removes a message from the messaging system.
removeMessage(messageID)
1=successful
0=error
To post a temporary message during processing:
vMessage:=postMessageProject("Processing..."); removeMessage(vMessage);
The removeSearchExclusion function removes an entry from the search exclusion list.
removeSearchExclusion(index)
1=successful
0=error
removeSearchExclusion(0);
* In shareable projects this function is exclusive to the administrator.
The return function returns the flow of control from a REQL script.
return()
None
To return at the end of a script:
return();
Writes the contents of a REQL set to the specified filename. The set can then be reloaded with the loadSetFromFile function
saveSetToFile(set, strFileName);
The scopeUID function sets the scope as a specified annotation so the relations that are added will be added to that annotation.
scopeUid(UID)
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);
The segregate function segregates system-wide database information for all loaded items in scope.
segregate()
1=successful
0=error
* In shareable projects this function is exclusive to the administrator.
The SetFind option determines if the specified element is within the specified set.
setFind(set,element)
If a non-negative number is returned, the element has been found in the set at the specified index.
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);
The setInteractiveMode function turns interactive mode on/off. When interactive mode is off the user is not prompted with confirmation message boxes.
setInteractiveMode(0|1)
1=successful
0=error
show setInteractiveMode(1);
The setOption function sets the specified strOption to the specified value or turns the option on/off. The following options are available:
setOption(strOption,1|0 or string value)
1=successful
0=error
setOption("EnableACL", 0); setOption("PublicAnnotationDir","c:\");
* In shareable projects this function is exclusive to the administrator.
The shellLoadFromFile function loads the specified text file into the current shell or report.
shellLoadFromFile(strFileName)
1=successful
0=error
open report; scope:=all; show cobol_var="*DATE*"; shellSaveToFile("c:\output.txt"); close report; //new report// open report; shellLoadFromFile("c:\outout.txt"); shellprint();
The shellPrint function displays a Print dialog.
shellPrint()
1=successful
0=error
The shellSaveToFile function saves current report or shell to the text file specified in the strFileName parameter.
shellSaveToFile(strFileName)
1=successful
0=error
The shellSetTitle function gives the current report or shell the title that is specified in the string parameter.
shellSetTitle(string)
open report; shellSetTitle("DATE IMPACT REPORT");
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.
showFunctions([string])
showFunctions("s*");
Returns all functions that begin with s.
Shows the currently defined REQL variables.
showVars([string]);
showVars("
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.
sort(set) sort(uservar <: set by REQL statement that returns an attribute)
Set of sorted elements
To sort paragraphs into their location order:
To sort variables into size order, with the smallest first:
show sort(x <: var by x:>attr_size);
Function sprintf writes formatted output to a string.
sprintf(strFormat[,argument...])
strvar:=sprintf show sprintf("%I %S", 3456, "Fred");
The status function performs status updates on all components in the loaded project.
status()
status();
* In shareable projects this function is exclusive to the administrator.
Function strconcat accepts two strings or variables containing strings and returns a string with the second concatenated onto the end of the first.
strconcat(string,string)
string
firstname := "John"; fullname := strconcat(firstname,"Doe"); show fullname;
Function strcopy copies the specified string to the specified variable.
strcopy(variable,string)
strcopy returns dest.
newvar:=""; strcopy(newvar, "John");
Function strlen accepts one string and returns a number representing the length of the string.
strlen(string)
Number
To assign the length of a path to a variable:
namelength:=strlen("c:\revolve\bin\revolve.exe");
The strscan function returns index of string2 specified within string1.
strscan(string1,string2)
show strscan("cats and dogs", "dogs");
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.
substr(string, first, length)
String
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);
The sum function returns the sum of the set of integers.
sum(set)
Number
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);
The timer function displays the current time down to hundreths of a second, as well as the elapsed time since the previous timer call.
timer()
show timer(); vcount:=count(COBOL_STATE); show timer();
For information on this function refer to the timerUpdate function.
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.
timerUpdate("title", "status string", i # of current, n # of total steps)
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();
The translate command adds the specified import translation to the current project.
translate"from" "to"
scope :=all; translate "test" testing"
* In shareable projects this function is exclusive to the administrator.
The uniquify function removes duplicated elements from the specified set.
uniquify(set)
Set
To uniquify a set of names which contains strings:
names:=uniquify(names);
The unlockUID function unlocks an annotation following an update.
unlockUID(annotation UID)
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);
The unused function takes a set of labels or statements and returns the subset which is never used.
unused(set)
Set of labels or statements
To show the CICS statements which are never used:
show yellow unused(cics_state);
The updateshared function updates the shareable database from a shadow project.
updateShared()
1=successful
0=error
makeAdmin(); updateshared();
* In shareable projects this function is exclusive to the administrator.
The varToField function maps a set of variables to related BMS/MFS fields.
varToField(set)
Set of elements.
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.
Language Constructs | Languages |