warum bringt folgender Code einen Fehler
error XS9089: Functions cannot have an INIT or EXIT clause.
Code: Select all
METHOD [Name]
LOCAL x AS DWORD
FOR x := 1 to 9999
IF [Bedingung]
EXIT
ENDIF
NEXT
Moderator: wriedmann
Code: Select all
METHOD [Name]
LOCAL x AS DWORD
FOR x := 1 to 9999
IF [Bedingung]
EXIT
ENDIF
NEXT
Code: Select all
FUNCTION Start( ) AS VOID
VAR t :=test{}
? t:z()
CLASS test
METHOD z() AS DWORD
LOCAL x AS DWORD
FOR x := 1 TO 9999
IF TRUE
EXIT
ENDIF
NEXT
RETURN x
END CLASS
Code: Select all
CLASS dlgLsBuchen INHERIT dlgLsBuchen_vo
PROTECT _cLiefnr AS STRING
PROTECT _aVor AS ARRAY
...
METHOD GetArtField(cCol AS STRING, lFormel := TRUE AS LOGIC)
LOCAL x AS DWORD
LOCAL odbAGR AS dbAgr
LOCAL nPos AS DWORD
...
nPos := AScan(_aVor, {|aVal|aVal[1] == Upper(cCol)}) // => XS9002
odbAgr := dbAgr{}
FOR x := 1 TO 9999
odbAgr:Seek({#LIEFNR, #AGRNR}, {_cLiefnr, x}, FALSE)
IF !odbAgr:Found .OR. odbAgr:FIELDGET(#TXT) == "SONSTIGES"
EXIT // => XS9089
ENDIF
NEXT
odbAgr:Close()