>>> Is there any way to accomplish strong typed programming
>>> in visual foxpro class that are created with visual foxpro
>>> class creation tool. For example how can i say a class method
>>> returns an integer value with "as integer"?
>>
>>No, VFP is a "late binding" language. Strong typing can not be accomplished. The only thing You can do is use naming conventions and discipline. You can initialize a numeric return-Value that will be altered when the method runs trough properly, and if not, the initial Value is returned.
>>
>>The following will surely cause problems
>>
>>
>>procedure ValidFile(tcFile as string) as integer
>>
>>if vartype(tcFile) # "C"
>> return
>>endif
>>
>>return iif( file(tcFile), 1, 0)
>>endproc
>>
>>
>>as You might get a type logical *or* nurmeric
>>
>>however this will work
>>
>>
>>procedure ValidFile(tcFile as string) as integer
>>
>>local lnRetVal
>>lnRetVal = -1
>>
>>if vartype(tcFile) # "C"
>> return lnRetVal
>>endif
>>
>>lnRetVal = iif( file(tcFile), 1, 0)
>>return lnRetVal
>>endproc
>>
>
>How about using only one return statement in the function/procedure? I know, it's could be very difficult...
My preference is like Frank's. Multiple returns is good:)
Cetin