Gamestudio Links
Zorro Links
Newest Posts
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
1 registered members (vicknick), 1,316 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
function predefinition #68325
03/26/06 18:08
03/26/06 18:08
Joined: Jan 2003
Posts: 4,305
Damocles Offline OP
Expert
Damocles  Offline OP
Expert

Joined: Jan 2003
Posts: 4,305
Actually, there is the requirement to define
function dummies, if a function is called in the
script, if the function itself is defined "lower" in the script.
Otherwise the function is not found. (sometimes the compiler finds it,
even if it is defined "lower", very strange)

How about that the compiler first checks the script for
all actions and function and variables, that are placed,
and then starts the real compilation,
this leaves the need for predefinition out,
And would speed up the implementation of new function a bit,

or is there some restriction to this mehtod?

Re: function predefinition [Re: Damocles] #68326
03/26/06 18:11
03/26/06 18:11
Joined: Mar 2003
Posts: 569
FRAJO Offline
User
FRAJO  Offline
User

Joined: Mar 2003
Posts: 569
function dummy_func;


function dummy_func()
{
....
}


------------------------------------------- ICQ: 242543712 Ich bin nicht hier und bin nicht da. Wo bin ich dann? ".." ("") ^ ^ This is the evil vampire bunny. Copy and paste him into your signiture to help him achieve world domination. Yeah
Re: function predefinition [Re: FRAJO] #68327
03/26/06 18:12
03/26/06 18:12
Joined: Jan 2003
Posts: 4,305
Damocles Offline OP
Expert
Damocles  Offline OP
Expert

Joined: Jan 2003
Posts: 4,305
Yes I know how to predefine functions,
but I dont see the deeper sense in this requirement.

Java for example does not require this.

Re: function predefinition [Re: Damocles] #68328
03/26/06 19:24
03/26/06 19:24
Joined: Jul 2004
Posts: 1,205
Greece
LarryLaffer Offline
Serious User
LarryLaffer  Offline
Serious User

Joined: Jul 2004
Posts: 1,205
Greece
Quote:

Otherwise the function is not found. (sometimes the compiler finds it,
even if it is defined "lower", very strange)




it will only find it if the function has none or one parameter. more than one parameters require the function to be predefined

I doubt they're gonna make any such improvements to c-script. Hopefully, lite_c will be more flexible in that matter


INTENSE AI: Use the Best AI around for your games!
Join our Forums now! | Get Intense Pathfinding 3 Free!
Re: function predefinition [Re: LarryLaffer] #68329
03/27/06 09:51
03/27/06 09:51
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The doubt is justified - the hope is not.

Re: function predefinition [Re: jcl] #68330
03/27/06 13:25
03/27/06 13:25
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
LOL!

Funny

Pretty much all structured programming languages and compilers need to have the functions, variables, classes, etc all defined before they are called. This is the basis of the structured approach, dating way back. I dont think Conitec is going to try to change this.


Sphere Engine--the premier A6 graphics plugin.
Re: function predefinition [Re: Matt_Aufderheide] #68331
03/28/06 13:43
03/28/06 13:43
Joined: Jan 2003
Posts: 4,305
Damocles Offline OP
Expert
Damocles  Offline OP
Expert

Joined: Jan 2003
Posts: 4,305
Java does not..
I guess the reason for the predefinition is just to have
it more simple to program the compiler.

Re: function predefinition [Re: Damocles] #68332
03/28/06 19:37
03/28/06 19:37
Joined: Jul 2000
Posts: 8,973
Bay Area
Doug Offline
Senior Expert
Doug  Offline
Senior Expert

Joined: Jul 2000
Posts: 8,973
Bay Area
Quote:

I guess the reason for the predefinition is just to have
it more simple to program the compiler.




Yes, but some people also find it useful for avoiding bugs (however, with today's compilers it probably isn't needed).

The main reason we'll probably stick with it is because it's done this way in C so it should be done this way in Lite-C.


Conitec's Free Resources:
User Magazine || Docs and Tutorials || WIKI

Moderated by  aztec, 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