FindInModules

Syntax

FindInModulesResult FindInModules(FindInModulesArg tArgs)

Parameters

tArgs. Operation execution parameters.

Description

The FindInModules operation searches for text by code of development environment objects.

Comments

The operation finds all units/forms, which code contains the specified string. The search is executed according to parameters specified in tArgs. The operation results in the list of found objects and also information about found text (string that contains the searched text and index of position in it).

Example

Below is the example of using the FindInModules operation to search the specified string in units code. The request contains moniker of the folder used in search, searched text, and other search options. The response contains information about the unit, which code contains searched text. The C# example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<FindInModules xmlns="http://www.fsight.ru/PP.SOM.Som">
<tArgs xmlns="">
<root>
  <id>S1!M!171999</id>
  </root>
  <caseSensitive>false</caseSensitive>
  <wholeWordsOnly>false</wholeWordsOnly>
  <findString>Create</findString>
  </tArgs>
  </FindInModules>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<FindInModulesResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<result xmlns="">
<it>
<moduleId>
  <id>M_ADDITIONAL</id>
  </moduleId>
  <foundLine>Public Constructor Create;</foundLine>
  <row>4</row>
  <pos>21</pos>
  </it>
<it>
<moduleId>
  <id>M_ADDITIONAL</id>
  </moduleId>
  <foundLine>End Constructor Create;</foundLine>
  <row>7</row>
  <pos>18</pos>
  </it>
<it>
<moduleId>
  <id>M_ADDITIONAL</id>
  </moduleId>
  <foundLine>Public Constructor CreateWithParams(Size: Integer; DefaultValue: Double = 0);</foundLine>
  <row>9</row>
  <pos>21</pos>
  </it>
<it>
<moduleId>
  <id>M_ADDITIONAL</id>
  </moduleId>
  <foundLine>End Constructor CreateWithParams;</foundLine>
  <row>15</row>
  <pos>18</pos>
  </it>
<it>
<moduleId>
  <id>M_ADDITIONAL</id>
  </moduleId>
  <foundLine>obj := New TestObject.CreateWithParams(10, 100);</foundLine>
  <row>27</row>
  <pos>24</pos>
  </it>
<it>
<moduleId>
  <id>M_ADDITIONAL</id>
  </moduleId>
  <foundLine>Debug.WriteLine("The main procedure is running. The object is created.");</foundLine>
  <row>28</row>
  <pos>64</pos>
  </it>
  </result>
  </FindInModulesResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"FindInModules" :
{
"tArgs" :
{
"root" :
{
"id" : "S1!M!171999"
},
"caseSensitive" : "false",
"wholeWordsOnly" : "false",
"findString" : "Create"
}
}
}

JSON response:

{
"FindInModulesResult" :
{
"result" :
{
"it" :
[
{
"moduleId" :
{
"id" : "M_ADDITIONAL"
},
"foundLine" : "Public Constructor Create;",
"row" : "4",
"pos" : "21"
},
{
"moduleId" :
{
"id" : "M_ADDITIONAL"
},
"foundLine" : "End Constructor Create;",
"row" : "7",
"pos" : "18"
},
{
"moduleId" :
{
"id" : "M_ADDITIONAL"
},
"foundLine" : "Public Constructor CreateWithParams(Size: Integer; DefaultValue: Double = 0);",
"row" : "9",
"pos" : "21"
},
{
"moduleId" :
{
"id" : "M_ADDITIONAL"
},
"foundLine" : "End Constructor CreateWithParams;",
"row" : "15",
"pos" : "18"
},
{
"moduleId" :
{
"id" : "M_ADDITIONAL"
},
"foundLine" : "obj := New TestObject.CreateWithParams(10, 100);",
"row" : "27",
"pos" : "24"
},
{
"moduleId" :
{
"id" : "M_ADDITIONAL"
},
"foundLine" : "Debug.WriteLine("The main procedure is running. The object is created.");",
"row" : "28",
"pos" : "64"
}
]
}
}
}
public static FindInModulesResult FindInModules(MbId mb, string root, string text)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tFind = new FindInModules()
{
tArgs = new FindInModulesArg()
{
findString = text,
root = new OdId() { id = mb.id + "!" + FindObjectById(mb, root).k },
caseSensitive = false,
wholeWordsOnly = false
}
};
//Search by unit code
var result = somClient.FindInModules(tFind);
return result;
}

See also:

Working with Development Environment