Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   static local variables (http://www.chiefdelphi.com/forums/showthread.php?t=62339)

Alan Anderson 23-01-2008 09:46

static local variables
 
Is there a correct way to define a variable inside a function as "static" so it retains a value between invocations of the function? I've resorted to a user code block in order to do it so far. Unfortunately, that doesn't make the variable "known" to the rest of the EasyC system -- it won't show up in the drop-down menus, for example.

Kingofl337 23-01-2008 10:11

Re: static local variables
 
1 Attachment(s)
You can use a user code block and it must be in the first line of the function. Like you mentioned, shown below but you are correct it will not make the variable known. We had this in easyC for FRC 2 years ago and it caused allot of problems with users mis-using it.


All times are GMT -5. The time now is 23:12.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi