Page 1 of 1

PB4 Win32 - Question about Protected

Posted: Tue May 16, 2006 12:39 am
by va!n
Trying to compile following codesnip alert an message that dAngle.d may be already declared. Maybe i misunderstand here something but shouldnt it possible and make sence to protect the variable dAngle.d inside this procedure too? thx

Code: Select all

Procedure ProtectedTest(dAngle.d)
  Protected dReturnValue.d
  Protected dAngle.d  
  ProcedureReturn dReturnValue
EndProcedure

Posted: Tue May 16, 2006 11:57 am
by Trond
Then how would you access the procedure parameter?

Posted: Tue May 16, 2006 1:26 pm
by Flype
since PB4.0,
procedures arguments are now automatically protected.
you can use an argument name even if it already use as global outside the procedure. So you do not need to 'Protected myVar' .
Thus, you'll save one line of code per argument :wink: