Gamestudio Links
Zorro Links
Newest Posts
Zorro tutorial ideas?
by mistery. 09/19/26 17:09
Trades during a running bar
by Martin_HH. 09/18/26 12:45
Capital slider is not saving in Z12
by frutza. 09/17/26 13:36
Avoiding pop-up training parameter results
by Martin_HH. 09/16/26 21:31
What are you working on?
by rayp. 09/16/26 20:20
Future of ZorroHFT
by TipmyPip. 09/16/26 09:28
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (AlleyRatStudios, LoT), 1,915 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
mistery, lokkalyansamiti, rahulbuilds, speedx, liop
19236 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 4 1 2 3 4
Re: the comparisons of if clauses are still executed completely [Re: Uhrwerk] #360437
02/23/11 22:30
02/23/11 22:30
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
functions with a variable argument number

Works fine for me (or am I missing sth?) :
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////


var add(var x, var y, var z) {
	return (x+y+z);
}

var add(var x, var y) {
	return (x+y);
}

void main() {
	video_screen = 0;
	printf("\n%d",(int)add(1,2));
	printf("\n%d",(int)add(1,2,3));
}




"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: the comparisons of if clauses are still executed completely [Re: Superku] #360438
02/23/11 22:34
02/23/11 22:34
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
The problem is that variadic functions don't work. Your example is just overloarding, but what Uhrwerk means is something like this:

Code:
void foo(char *format, ...)
{
   va_list args;
   va_start(args, format);

   // Do something with the format string

   va_end(args);
}



Btw, declaring functions which take variable arguments is already supported, but va_list, va_start, va_arg, va_end and va_copy is missing.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Page 4 of 4 1 2 3 4

Moderated by  aztec, Spirit 

Gamestudio download | 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