Return value - compile error
Posted: Fri Dec 21, 2018 5:15 pm
Guys,
i´ve compiled a app with the 2.0.0.8 build and i´m wondering what the compiler is trying to tell me :
warning XS9032: This entity type cannot return a value. Return value ignored.
error XS1520: Method must have a return type
Compilation failed (1 error, 1 warning)
i could isolate the problem to a VO Dialogwindow - other VO windows compile as expected. The attached and simplified viaef contains the partial class DlgText. As soon the code in the "DlgText" modul is deactivated i can compile and run the app, otherwise i get the error/warning above.
Honestly, i don´t get it - what is the problem ?
regards
Karl-Heinz
// dlgText_vo generated code
// dlgText.prg user code
i´ve compiled a app with the 2.0.0.8 build and i´m wondering what the compiler is trying to tell me :
warning XS9032: This entity type cannot return a value. Return value ignored.
error XS1520: Method must have a return type
Compilation failed (1 error, 1 warning)
i could isolate the problem to a VO Dialogwindow - other VO windows compile as expected. The attached and simplified viaef contains the partial class DlgText. As soon the code in the "DlgText" modul is deactivated i can compile and run the app, otherwise i get the error/warning above.
Honestly, i don´t get it - what is the problem ?
regards
Karl-Heinz
// dlgText_vo generated code
Code: Select all
PARTIAL CLASS DlgText INHERIT DIALOGWINDOW
PROTECT oDCsleText AS SINGLELINEEDIT
PROTECT oCCPshOk AS PUSHBUTTON
// User code starts here (DO NOT remove this line) ##USER##
CONSTRUCTOR(oParent,uExtra) // ----------- Error ????
SELF:PreInit(oParent,uExtra)
SUPER(oParent , ResourceID{"DlgText" , _GetInst()} , TRUE)
SELF:oDCsleText := SINGLELINEEDIT{SELF , ResourceID{ DLGTEXT_SLETEXT , _GetInst() } }
SELF:oDCsleText:HyperLabel := HyperLabel{#sleText , NULL_STRING , NULL_STRING , NULL_STRING}
SELF:oCCPshOk := PUSHBUTTON{SELF , ResourceID{ DLGTEXT_PSHOK , _GetInst() } }
SELF:oCCPshOk:HyperLabel := HyperLabel{#PshOk , "Ok" , NULL_STRING , NULL_STRING}
SELF:Caption := "Dialog Caption"
SELF:HyperLabel := HyperLabel{#DlgText , "Dialog Caption" , NULL_STRING , NULL_STRING}
SELF:PostInit(oParent,uExtra)
RETURN SELF // ---------------- Warning ????
END CLASS
STATIC DEFINE DLGTEXT_SLETEXT := 100
STATIC DEFINE DLGTEXT_PSHOK := 101
Code: Select all
PARTIAL CLASS DlgTExt
METHOD PostInit(oParent,uExtra)
SUPER:PostInit ( oParent , uExtra )
oDCSleText:Value := uExtra [ 1 ]
RETURN SELF
ACCESS sleText
RETURN oDCSleText:Value
METHOD PshOk()
IF ! Empty ( oDCSleText:VALUE )
SELF:EndDialog ( IDOK )
ELSE
oDCSleText:SetFocus()
ENDIF
RETURN SELF
END CLASS