Active Topics Memberlist Calendar Search Help | |
Register Login |
One Stop Testing Forum : Testing Tools @ OneStopTesting : SilkTest @ OneStopTesting |
Topic: Donate a user defined function to this topic !!! |
|
Author | Message | |
tanushree
Senior Member Joined: 04Apr2007 Online Status: Offline Posts: 2160 |
Topic: Donate a user defined function to this topic !!! Posted: 12Oct2007 at 5:25am |
|
Here's a variation on Verify that strongly prefer over the original.
code:[+] VerifyAndContinue( anytype pInActual ,anytype pInExpected ,string pDesc ) Post Resume: Click here to Upload your Resume & Apply for Jobs |
||
IP Logged | ||
ram7vasu
Newbie Joined: 22Nov2007 Location: India Online Status: Offline Posts: 29 |
Posted: 08Jan2008 at 1:49am | |
//search forward to find first occurrence of "the" Print (StrPos ("the", s)) // prints: 8 //search backward to find second occurrence of "the" Print (StrPos ("the", s, TRUE)) // prints: 25 Print (StrPos ("x", s)) // prints: 0 RandPick function Returns a random item from a list. Syntax aElem = RandPick (lList) Notes Example2: testcase RandPickExample () LIST OF STRING lsItems STRING sRandomItem lsItems = {...} "Clam Chowder" "Fried Chicken" "Lobster" "Green Eggs and Ham" sRandomItem = RandPick (lsItems) Print ("The special of the day is {sRandomItem}.") |
||
RAM SAKSOFT
|
||
IP Logged | ||
ram7vasu
Newbie Joined: 22Nov2007 Location: India Online Status: Offline Posts: 29 |
Posted: 08Jan2008 at 2:13am | |
|
||
RAM SAKSOFT
|
||
IP Logged | ||
ram7vasu
Newbie Joined: 22Nov2007 Location: India Online Status: Offline Posts: 29 |
Posted: 08Jan2008 at 2:17am | |
[-] testcase DBTester () appstate none [ ] [ ] // Use the QA DBTester functions to access the GMO database [ ] // Print GMO's customer list [ ] [ ] STRING custnum, lname, fname [ ] HDATABASE hdbc [ ] HSQL hstmnt [ ] [ ] // connect to the GMO Microsoft Access database, gmt.db [ ] hdbc = DB_Connect ("dsn=gmovb") [ ] [ ] // retrieve everything from the customer table [ ] hstmnt = DB_ExecuteSql (hdbc, "SELECT * FROM cidb ORDER BY last_name") [ ] [ ] // process the retrieved data and print customer names [ ] print ("GMO Customer List:") [ ] print () [-] while (DB_FetchNext (hstmnt, custnum, fname, lname)) [ ] print ("{lname}, {fname}") [ ] [ ] // release resources [ ] DB_FinishSql (hstmnt) [ ] [ ] // disconnect from the GMO database [ ] DB_Disconnect (hdbc) |
||
RAM SAKSOFT
|
||
IP Logged | ||
Forum Jump |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
© Vyom Technosoft Pvt. Ltd. All Rights Reserved.