Issue 51725 - DE: Wrong localization of static declaration: basic-example
Summary: DE: Wrong localization of static declaration: basic-example
Status: CLOSED FIXED
Alias: None
Product: documentation
Classification: Unclassified
Component: Online help (show other issues)
Version: current
Hardware: PC Linux, all
: P4 Trivial (vote)
Target Milestone: OOo 2.0.4
Assignee: mwaller
QA Contact: issues@documentation
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-08 12:38 UTC by villeroy
Modified: 2006-05-22 11:41 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
spreadsheet with 2 forms and related dbase-databases (18.14 KB, application/x-gzip)
2005-07-26 22:26 UTC, villeroy
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description villeroy 2005-07-08 12:38:36 UTC
The example makes no sence since it demonstrates nothing.
Sub ExampleStatic
Static iInit As Integer
if iInit = 0 then iInit = InitVar()REM kontrolliere ob Variable schon
initialisiert wurde
iInit = iInit + 1
MsgBox iInit,0,"Die Antwort lautet"
End Sub
REM Funktione zur initialisierung der statischen Variablen
Function InitVar() As Integer
InitVar = 40 REM ein Wert zur Initialisierung
End Function
The static var should be declared in the called function, not in the calling one.
Consider this:
Sub ExampleStatic
Dim iCount as Integer, iResult as Integer
For iCount = 0 to 2
	iResult = InitVar()
Next iCount
MsgBox iResult,0,"Die Antwort lautet"
End Sub

REM Funktion zur initialisierung der statischen Variablen mit einem Minimalwert
Function InitVar() As Integer
Static iInit As Integer
Const iMinimum as Integer = 40 REM gebe diesen Wert als Minimum der Funktion zurück
if iInit = 0 then   REM kontrolliere ob Variable schon initialisiert wurde
	iInit = iMinimum
else
	iInit = iInit + 1
end if
InitVar = iInit
End function
Comment 1 Uwe Fischer 2005-07-08 13:38:07 UTC
Your example will replace the wrong example in file text/sbasic/shared/03103500.xhp 
Comment 2 villeroy 2005-07-26 22:26:12 UTC
Created attachment 28241 [details]
spreadsheet with 2 forms and related dbase-databases
Comment 3 Uwe Fischer 2005-11-11 12:18:08 UTC
changed text\sbasic\shared\03103500.xhp

->Villeroy: Your attachment entered the wrong issue. No damage done.
Comment 4 Uwe Fischer 2005-11-23 12:40:36 UTC
please verify in CWS hc680fin

re-open issue and reassign to jsk@openoffice.org
Comment 5 Uwe Fischer 2005-11-23 12:40:41 UTC
reassign to jsk@openoffice.org
Comment 6 Uwe Fischer 2005-11-23 12:40:47 UTC
reset resolution to FIXED
Comment 7 Uwe Fischer 2006-01-18 15:03:33 UTC
changed target
Comment 8 Uwe Fischer 2006-02-07 09:06:15 UTC
pls verify

re-open issue and reassign to mwaller@openoffice.org
Comment 9 Uwe Fischer 2006-02-07 09:06:23 UTC
reassign to mwaller@openoffice.org
Comment 10 Uwe Fischer 2006-02-07 09:06:27 UTC
reset resolution to FIXED
Comment 11 mwaller 2006-02-07 14:37:38 UTC
issue verified in CWS hc680fin
Comment 12 mwaller 2006-05-22 11:41:54 UTC
issue closed