Super Gernot das das STATIC gekommen ist,
damit kann man ansich Globale Variablen super Abkapseln.
Als Beispiel eine Frame Anzeige.
Voher:
GLOBAL fps_time,fps_counter,fps,fps_temp
FUNCTION updatefps:
fps_time = GETTIMERALL()
fps_counter = fps_counter + 1
IF (fps_time-fps_temp)>1000
fps_temp = fps_time
fps = fps_counter
fps_counter = 0
ENDIF
Return fps
ENDFUNCTIONUnd jetzt mit STATIC ohne die "gefahr" der Globalen Variablen:
FUNCTION getfps:
STATIC fps_time,fps_counter,fps,fps_temp
fps_time = GETTIMERALL()
fps_counter = fps_counter + 1
IF (fps_time-fps_temp)>1000
fps_temp = fps_time
fps = fps_counter
fps_counter = 0
ENDIF
RETURN fps
ENDFUNCTIONDanke
Ja ist ne schöne sache das ;)
find ich aucH ;)