You are on page 1of 1

Deskcheck Example:

Variables:
intX - integer
blnMatch - boolean
strCurr - string
strComp - string

Function fncheck (strFirst, strSec : string; intLen: integer) Return value - boolean
1 blnMatch = true
2 For intX = 0 to intLen - 1 do
3 strCurr = Substring(strFirst, intX, 1)
4 strComp = Substring(strSec, intX, 1)
5 If strCurr <> strComp then
6 blnMatch = false
7 End if
8 Next
9 Return blnMatch
End Function

Identify the variables


The first column contains the code
Each variable becomes a column (including parameters / arguments – variables passed
into the function)
For each row, the contents of the variables are recorded

In this case you have7 variables:


For this example, strFirst = “abc”, strSec = “abb”, intLen = 3

Code intX blnMatch strCurr strComp strFirst strSec intLen


1 true abc abb 3
2 0 true abc abb 3
3 0 true a abc abb 3
4 0 true a a abc abb 3
5 – False 0 true a a abc abb 3
2 1 true a a abc abb 3
3 1 true b a abc abb 3
4 1 true b b abc abb 3
5 – False 1 true b b abc abb 3
2 2 true b b abc abb 3
3 2 true c b abc abb 3
4 2 true c b abc abb 3
5 – True 2 true c b abc abb 3
6 2 false c b abc abb 3

You might also like