From: Karl Faller on
Erik,
>Yeh, we have been told a lot of rubish.
>Like we need return statements to make our code Vulcan ready.
>But like other .NET languages, Vulcan accepts methods without a return
>statement perfectly. .
well:

FUNCTION Start() AS VOID
myt()
RETURN

FUNCTION myt()
? "TEST"

error VN4006: 'myt' : missing 'RETURN' statement

Karl
From: E®!k /!sser on
Hi Karl,

This compiles fine. It is a new winform application in VS2008, and I removed
the Return statements at the end of the methods.

Erik

CLASS Form1 INHERIT System.Windows.Forms.Form

/// <summary>
/// Required designer variable.
/// </summary>
PRIVATE INSTANCE components AS System.ComponentModel.IContainer

CONSTRUCTOR()
SUPER()
SELF:InitializeComponent()
RETURN

/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed;
otherwise, false.</param>
PROTECTED METHOD Dispose( disposing AS LOGIC ) AS VOID
IF disposing && components != NULL
components:Dispose()
ENDIF
SUPER:Dispose( disposing )

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
PRIVATE METHOD InitializeComponent() AS VOID
SELF:components := System.ComponentModel.Container{}
SELF:AutoScaleMode := System.Windows.Forms.AutoScaleMode.Font
SELF:Text := "Form1"


END CLASS



"Karl Faller" <k.faller_withoutthat_(a)onlinehome.de> schreef in bericht
news:1tajd51amktn4clkk7fl4rnck54q7759nj(a)4ax.com...
> Erik,
>>Yeh, we have been told a lot of rubish.
>>Like we need return statements to make our code Vulcan ready.
>>But like other .NET languages, Vulcan accepts methods without a return
>>statement perfectly. .
> well:
>
> FUNCTION Start() AS VOID
> myt()
> RETURN
>
> FUNCTION myt()
> ? "TEST"
>
> error VN4006: 'myt' : missing 'RETURN' statement
>
> Karl

From: Karl Faller on
Strange. I can second that your code compiles, but:

CLASS test
PROTECTED METHOD mytest()
? "T"
END CLASS

compiles not.

Karl
From: E®!k /!sser on
Richard,

> Just because a compiler will tolerate sloppy programming is no reason
> to continue being sloppy ... its - [cannot find suitable words] !

Nobody, really nobody here ever complained about VO allowing sloppy
programming because you could do without a return statement.
Nobody here ever asked if the compiler could check for a return statement as
mandatory last line.
Such a thing could only come from some sort of fundamentalist idea about
programming (IMO) .

And if it was so very very important , why does Vulcan still allow it? And
why does C# allow it?

regards,

Erik







From: Chris Pyrgas on

Hi Karl,

> Strange. I can second that your code compiles, but:
>
> CLASS test
> PROTECTED METHOD mytest()
> ? "T"
> END CLASS
>
> compiles not.

It's because your method has CLIPPER calling convention and must return
something (a USUAL).
The methods Erik listed are strongly typed AS VOID methods, that do not
return anything anyway.

regards,
Chris


First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6
Prev: Application Icon
Next: VO on a stick