Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (VoroneTZ, vicknick), 802 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Function Vs. Void #449452
03/20/15 23:50
03/20/15 23:50
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
And in this corner...

No but seriously.. what is the difference in the two, and the advantages / disadvantages between the two - Ex. are there any limitations?


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Function Vs. Void [Re: DLively] #449454
03/21/15 00:31
03/21/15 00:31
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Nothing I guess. As far as I know "function" is a relict from the C-Script (WDL) age.


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Function Vs. Void [Re: alibaba] #449455
03/21/15 00:38
03/21/15 00:38
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
void cant return anything aka 0xC3 in assembler
Function is equivalent to var, meaning you can return a var aka 0xC2 in assembler.
0xC2 is followed by a WORD (2 bytes) with parameter count in bytes to clear the stack (if its stdcall, fastcall or thiscall)

Last edited by Ch40zzC0d3r; 03/21/15 00:41.
Re: Function Vs. Void [Re: Ch40zzC0d3r] #449456
03/21/15 00:54
03/21/15 00:54
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Hmm... So if I understand you correctly, a void can't have void(VECTOR* temp) but 'function()' can.

edit: Because if the function returns a parameter, it can be temp = function(temp); but temp = void(temp); is not allowed?

Last edited by DLively; 03/21/15 00:56.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Function Vs. Void [Re: DLively] #449464
03/21/15 09:02
03/21/15 09:02
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
A void cant return a value, a function can return a var value, thats the difference.

Re: Function Vs. Void [Re: Ch40zzC0d3r] #449465
03/21/15 09:42
03/21/15 09:42
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
awesome. Im Glad I finally got this covered up... I've been wondering about that for some time but never got around to asking the question... Thanks Cha0zzC0d3r laugh


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Function Vs. Void [Re: DLively] #449466
03/21/15 09:51
03/21/15 09:51
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
function is just an alias for var.
Both are defined with as fixed:
Code:
typedef fixed var;
typedef fixed function;


So you can actually do this:
Code:
function a, b;
a = 10;
b = 20;
printf("%f", a + b);



Regards


Visit my site: www.masterq32.de
Re: Function Vs. Void [Re: MasterQ32] #449469
03/21/15 10:05
03/21/15 10:05
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
MIND BLOWN laugh
Makes perfectly good sense in combination with the above answer.

Last edited by DLively; 03/21/15 10:11.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Function Vs. Void [Re: DLively] #449470
03/21/15 10:51
03/21/15 10:51
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Sometimes its a good thing to look at your include files wink
There you can learn much about the engine itself


Visit my site: www.masterq32.de
Re: Function Vs. Void [Re: MasterQ32] #449473
03/21/15 11:32
03/21/15 11:32
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Well I was wrong then grin


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1