Active TopicsActive Topics  Display List of Forum MembersMemberlist  CalendarCalendar  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin


 One Stop Testing ForumTesting Tools @ OneStopTestingQuickTest Pro @ OneStopTesting

Message Icon Topic: HP QuickTest Pro and Data table Formula

Post Reply Post New Topic
Author Message
Mithi25
Senior Member
Senior Member
Avatar

Joined: 23Jun2009
Online Status: Offline
Posts: 288
Quote Mithi25 Replybullet Topic: HP QuickTest Pro and Data table Formula
    Posted: 27Oct2009 at 11:55pm
This page provides some useful formulas that can be used in the Data Table. Any combination of the formulas below is acceptable. The formulas refer to the data in cell A1 but may be applied to any cell.

 For more information on Data Table formulas, refer to Microsoft Excel documentation. All Microsoft Excel formulas can be used in the Data Table.

 First word in a sentence:

 =LEFT(A1,SEARCH("",A1,1))

 First three words in a sentence:

 =LEFT(A1,SEARCH("@",SUBSTITUTE(A1,"","@",3),1))

 Part of the sentence starting with the fourth word:

 =MID(A1,SEARCH("@",SUBSTITUTE(A1,"","@",3),1),LEN(A1))

 The part of the sentence starting with "word":

 =MID(A1,SEARCH("word",A1,1),LEN(A1))

 Check if two strings are equal:

 =EXACT(A1,"text2")

 Duplicate the string three times:

 =REPT(A1,3)

 Concatenation of two strings:

 ="Hello " & "There"

 Today's date:

 =TODAY()

 Generate a random uppercase letter:

 =CHAR(( RAND() *26) +65)

Validating and Passing Data Back to the Server

The simple validation example uses a plain button control. If a Submit control was used, the example would never see the data to check it — everything would go immediately to the server. Avoiding the Submit control lets you check the data, but it doesn't submit the data to the server. That requires an additional line of code:

<SCRIPT LANGUAGE="VBScript"> 
<!--
Sub Button1_OnClick
 Dim TheForm
 Set TheForm = Document.ValidForm
 If IsNumeric(TheForm.Text1.Value) Then
    If TheForm.Text1.Value < 1 Or TheForm.Text1.Value > 10 Then
      MsgBox "Please enter a number between 1 and 10."
    Else
      MsgBox "Thank you."
      TheForm.Submit   ' Data correct; send to server.
    End If
 Else
    MsgBox "Please enter a numeric value."
 End If
End Sub
-->
</SCRIPT>

To send the data to the server, the code invokes the Submit method on the form object when the data is correct. From there, the server handles the data just as it otherwise would — except that the data is correct before it gets there.




Post Resume: Click here to Upload your Resume & Apply for Jobs

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

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



This page was generated in 1.734 seconds.
Vyom is an ISO 9001:2000 Certified Organization

© Vyom Technosoft Pvt. Ltd. All Rights Reserved.

Privacy Policy | Terms and Conditions
Job Interview Questions | Placement Papers | Free SMS | Freshers Jobs | MBA Forum | Learn SAP | Web Hosting