Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
void & functions #390809
01/04/12 20:53
01/04/12 20:53
Joined: Jul 2011
Posts: 39
G
Giti Offline OP
Newbie
Giti  Offline OP
Newbie
G

Joined: Jul 2011
Posts: 39
hi.
in lite-c :
What is the matter with void and function and action?

Re: void & functions [Re: Giti] #390822
01/05/12 00:04
01/05/12 00:04
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
void != function == voids can´t return arguments..

means:
Code:
void calc(var a, var b)
{
    var c = a+b;
    return(c);
}



won´t give C back..

Code:
function calc(var a, var b)
{
    var c = a+b;
    return(c);
}


C is given back

Actions are nearly the same as functions (you can assign a void or a function to an entity, too). But actions are displayed in the WED Action list.. functions and voids not.


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: void & functions [Re: Espér] #390826
01/05/12 00:46
01/05/12 00:46
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
and iirc function uses VAR as return type.
Just in case someone thinks about floating point precision.


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: void & functions [Re: Rackscha] #390848
01/05/12 10:51
01/05/12 10:51
Joined: Jul 2011
Posts: 39
G
Giti Offline OP
Newbie
Giti  Offline OP
Newbie
G

Joined: Jul 2011
Posts: 39
tanx.

if i use the freeze_mode=2; , then void's are paused like functions?

Last edited by Giti; 01/05/12 11:30.
Re: void & functions [Re: Giti] #390856
01/05/12 12:30
01/05/12 12:30
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Yes, they'll freeze, too. laugh


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: void & functions [Re: Espér] #390860
01/05/12 12:55
01/05/12 12:55
Joined: Jul 2011
Posts: 39
G
Giti Offline OP
Newbie
Giti  Offline OP
Newbie
G

Joined: Jul 2011
Posts: 39
tanx guys.

Re: void & functions [Re: Espér] #390861
01/05/12 13:03
01/05/12 13:03
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: Espér
void != function == voids can´t return arguments..

Not quite right, void is simply a signal that the function won't return anything. That doesn't mean that 'return c' wouldn't work, it would still move the content of c into eax and the caller could use the returned argument.

@OP: The thing before the function name is a signal about what the function will return to you, for example you can also have:
Code:
int calc(int a, int b);


Or any other valid data type*

*except of structs, they can't be returned on the stack by Lite-C. However, you don't want to return stuff larger than the word width of the processor for performance reasons!


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: void & functions [Re: WretchedSid] #390865
01/05/12 13:12
01/05/12 13:12
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
thx sid, will remember this the next time laugh


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<

Moderated by  HeelX, Spirit 

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