While looking for something completely else in the Domino Designer 7 Help I stumbled over the Deftype keyword. I find it hard to find any usage for it but then again I always code with Options Explicit/Declare and type all my variables but still… Anyone who have actually used it and can give an example?
Deftype Statements
Set the default data type for variables, functions, and properties whose names begin with one of a specified group of letters..
I have not used it, but I know people sometimes like to use the first letter to signify type, as in fCost is a float and iCount is an integer, but dCost is a double and lCount is a long.
I have run across code where in the Options section there was the following:
Defcur c
Defdbl d
Defint i
Deflng l
Defsng g
Defstr s
Defvar v
Then, the coder would declare variables like this…
Dim cEarnedAnnPremAccm
Dim cDedAmtPerAcc
Dim cDedAmtAgg
Dim lPolicyLink
Dim lRecNotWritten
Dim lPosition
Dim iLoopCntr
Dim iTotalNumOfPolicies
Dim iThreadsafe
Dim vStatus
So three currency variables, three longs, three integers, and a variant.
Initially it was hard to remember what ‘identifier’ went with what type, but after a day of reading his code, it wasn’t that big of deal. Don’t know what he was trying to gain from doing that way…maybe just personal consistency (and he was a Declare Explicit type of coder)