IFSM298P – Introduction to PowerBuilder

Calculator Testing

 

Calculation Buttons Keyboard Standard

12345678 * 10 __________ __________ ERROR

square root of 2 __________ __________ 1.4142135

235 + 11 / 6 __________ __________ 41

1.23 * 2.34 __________ __________ 2.8782

1.2857 - .00005 __________ __________ 1.28565

5/0 __________ __________ ERROR

square root of –100 __________ __________ ERROR

29/11 __________ __________ 2.6363636

 

 

Helpful Functions

Pos - Finds one string within another string.

Pos ( string1, string2 {, start } )

Argument Description

string1 The string in which you want to find string2

string2 The string you want to find in string1

start (optional) A long indicating where the search will begin in string1. The default is 1

Return value

Long. Returns a long whose value is the starting position of the first occurrence of string2 in string1 after the position specified in start. If string2 is not found in string1 or if start is not within string1, Pos returns 0. If any argument's value is NULL, Pos returns NULL.

 

 

Round - Rounds a number to the specified number of decimal places.

Round ( x, n )

Argument Description

x The number you want to round

n The number of decimal places to which you want to round x. Valid values are 0 through 18

Return value

Decimal. Returns x rounded to the specified number of decimal places if it succeeds, and null if it fails or if any argument's value is NULL.