fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Return value - compile error

Return value - compile error 3 months 2 days ago #1

  • Karl-Heinz
  • Karl-Heinz's Avatar Topic Author
  • Offline
  • Posts: 189
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
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

// dlgText.prg user code
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

Attachments:

Please Log in or Create an account to join the conversation.

Return value - compile error 3 months 2 days ago #2

What happens when you remove the self after the return?

Please Log in or Create an account to join the conversation.

Return value - compile error 3 months 2 days ago #3

Hi Karl-Heinz,

The compiler does not try to tell you anything, this is a bug :). But fortunately there's an easy workaround, just change yout PARTIAL CLASS declarations wo that both have the same casing (currently one is "DlgText" and the other "DlgTExt") and it will work.

Thanks for the report, will log this so this will be fixed for the next release the latest.

About the warning in the constructor(), this is a correct one, constructors in .Net do not return anything, so the RETURN value is being ignored.

Chris
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

Return value - compile error 3 months 2 days ago #4

  • Karl-Heinz
  • Karl-Heinz's Avatar Topic Author
  • Offline
  • Posts: 189
The second CaSe SensitiVe trap in the last 2 weeks - I'm shocked. :woohoo:
Are there even more buried somewhere ? :-)

Please Log in or Create an account to join the conversation.

Return value - compile error 3 months 2 days ago #5

Possibly....:)

(but not any known ones at least)
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

  • Page:
  • 1