Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - SyedJunaid

Pages: [1]
1
Hi Geert,
              I think we will need to loop to store multiple parameters, i can see two seperate parameters in Msgbox and if I store in variable i can see the last variables , can you help me store multiple values in a variables as a string?

--------------------------------
input : FUNC(PARAM1, PARAM2)

dim param as EA.Parameter
dim parameter as EA.Parameter
for each parameter in theMethod.Parameters
param = parameter.Name
next
         
Msgbox "parameter: " & param

Observed Output: PARAM2

Expected Ouput: PARAM1, PARAM2

2
Thank You soo much Geert, Now it works  :D

Regards,
Syed Junaid

3
There is a function as mentioned below in project browser under a class as an operation

FUNC(Std_ReturnType, CDD_XCP_CODE)

I can get the function name using the code below :

dim theMethod as EA.Method
set theMethod = Repository.GetTreeSelectedObject()
Msgbox "The name of selected Method is: " & theMethod.Name

-------------------------------------------------------------------

The same way I want to get the function parameters, the code which I wrote is not working and is mentioned below:

dim str as EA.Method
dim theMethod as EA.Method
set theMethod = Repository.GetTreeSelectedObject()
Msgbox "The name of selected Method is: " & theMethod.Name

Msgbox "Parameters" & theMethod.Parameters.GetByName(str.Name)

Error Ouput: Object required : "theMethod.Parameters"

4
General Board / How to read function parameters Using VbScript
« on: November 17, 2021, 10:49:49 pm »
         dim theMethod as EA.Method
         dim Ranges as EA.Method
         dim containers as EA.Method
         set theMethod = Repository.GetTreeSelectedObject()
         
         containers = theMethod.Notes
         
         Msgbox "The name of selected Method is: " & theMethod.Name
         
         Msgbox "Content in Notes ealier" & container
         
         
         
         'code for reading parameters
         dim str1 as EA.Method
         'dim str1 as EA.Parameter (used this line as well) commented now
         dim str2 as EA.Method
         'dim str2 as EA.Parameter (used this line as well) commented now
         
         dim temp as EA.Method
         set temp = Repository.GetTreeSelectedObject()
         dim catch as EA.Method
         'dim catch as EA.Parameter (used this line as well)  commented now
         catch = temp.Parameters.GetByName(str1.Name,str2.Name)

Input : FUNC(Std_ReturnType, CDD_XCP_CODE)

expected output: Std_ReturnType, CDD_XCP_CODE

Output:
getting this error:::::::::::::

object required: 'temp.parameter'

5
         dim theMethod as EA.Method
         dim Ranges as EA.Method
         dim containers as EA.Method
         set theMethod = Repository.GetTreeSelectedObject()
         
         containers = theMethod.Notes
         
         Msgbox "The name of selected Method is: " & theMethod.Name
         
         Msgbox "Content in Notes ealier" & container
         
         
         
         'code for reading parameters
         dim str1 as EA.Method
         'dim str1 as EA.Parameter (used this line as well) commented now
         dim str2 as EA.Method
         'dim str2 as EA.Parameter (used this line as well) commented now
         
         dim temp as EA.Method
         set temp = Repository.GetTreeSelectedObject()
         dim catch as EA.Method
         'dim catch as EA.Parameter (used this line as well)  commented now
         catch = temp.Parameters.GetByName(str1.Name,str2.Name)

Input : FUNC(Std_ReturnType, CDD_XCP_CODE)

expected output: Std_ReturnType, CDD_XCP_CODE

Output:
getting this error:::::::::::::

object required: 'temp.parameter'

Pages: [1]