cancel
Showing results for 
Search instead for 
Did you mean: 

Sum of two variable values

gdave
Regular Contributor

Re: Sum of two variable values

Hi @ebarbera 

 

Much appreciated.

 

The project is in Delphi.

 

Thanks

G

ebarbera
Staff

Re: Sum of two variable values

Hi @gdave 

 

function GetSubString;
var Str;
begin
Str := '$40,900.99';

// Uses the SubString method
Log.Message( aqString.Replace(Str, '$', '') ); // Posts "1234"
Log.Message( aqString.Replace(Str, ',', '') ); // Posts "45678"
Log.Message(Str); // Posts "789"

end;

 

 

This should do what you are looking for! Let me know if you have any questions.  You can run this in a keyword test using a "Run Script Routine" operation. Also you will want to use a persistent project level variable to store the variable so you can manipulate it in the function and then use it in your checkpoint.

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors