Print as per the value entered for the variable. - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Interview Questions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Interview-Questions) +--- Thread: Print as per the value entered for the variable. (/Thread-Print-as-per-the-value-entered-for-the-variable) |
Print as per the value entered for the variable. - vibhakhandelwal - 10-18-2011 hi, I was asked this question: Write a Logic/program/function in QTP Given a variable, print/display * (stars) as per the value of the variable entered. say if the variables value is 5 then stars should be printed 5 times. ***** RE: Print as per the value entered for the variable. - sreekanth chilam - 10-18-2011 Hi, Here we go... Code: temp="" In the same way you can play with below examples as well. Execute the below code and see Code: For j=1 to 10 Code: For j=10 to 1 step-1 RE: Print as per the value entered for the variable. - inborntester - 03-02-2012 String(n,"*") RE: Print as per the value entered for the variable. - swathi - 03-05-2012 (03-02-2012, 04:35 PM)inborntester Wrote: String(n,"*") The following example uses the String function to return repeating character strings of the length specified: Code: Dim MyString RE: Print as per the value entered for the variable. - VenkateswaRao - 03-05-2012 Code: Dim var |