Double salvo function
-
I just read a function code like this : :laugh:
function MightyFunction(paramA, paramB, paramC)
! Lots of code here.
! But this is the magic.
Return retA
Return retBThe code is written in Centura 1.5, and the compiler compiled it successfully.
It's easy to laugh, but, it's so hard to smile ...
-
I just read a function code like this : :laugh:
function MightyFunction(paramA, paramB, paramC)
! Lots of code here.
! But this is the magic.
Return retA
Return retBThe code is written in Centura 1.5, and the compiler compiled it successfully.
It's easy to laugh, but, it's so hard to smile ...
That would compile in Visual Studio also. Just a warning about "unreachable code detected".
-
I just read a function code like this : :laugh:
function MightyFunction(paramA, paramB, paramC)
! Lots of code here.
! But this is the magic.
Return retA
Return retBThe code is written in Centura 1.5, and the compiler compiled it successfully.
It's easy to laugh, but, it's so hard to smile ...
-
That would compile in Visual Studio also. Just a warning about "unreachable code detected".
-
I just read a function code like this : :laugh:
function MightyFunction(paramA, paramB, paramC)
! Lots of code here.
! But this is the magic.
Return retA
Return retBThe code is written in Centura 1.5, and the compiler compiled it successfully.
It's easy to laugh, but, it's so hard to smile ...
Hmm, for some reason that reminds me of the custom scripting language used in the game "Space Empires V"... one of its unique quirks was that a "return" statement did not actually terminate function execution! So the function you describe would in SE5 script wind up returning retB, because it's the last return statement to execute...
-
Hmm, for some reason that reminds me of the custom scripting language used in the game "Space Empires V"... one of its unique quirks was that a "return" statement did not actually terminate function execution! So the function you describe would in SE5 script wind up returning retB, because it's the last return statement to execute...
Pascal also has a non terminating return semantics, but it's much clearer than that (as could be expected from Pascal ;))!
'As programmers go, I'm fairly social. Which still means I'm a borderline sociopath by normal standards.' Jeff Atwood 'I'm French! Why do you think I've got this outrrrrageous accent?' Monty Python and the Holy Grail
-
Pascal also has a non terminating return semantics, but it's much clearer than that (as could be expected from Pascal ;))!
'As programmers go, I'm fairly social. Which still means I'm a borderline sociopath by normal standards.' Jeff Atwood 'I'm French! Why do you think I've got this outrrrrageous accent?' Monty Python and the Holy Grail