]> git.xonotic.org Git - xonotic/gmqcc.git/blob - tests/varargs.qc
vararg testcases
[xonotic/gmqcc.git] / tests / varargs.qc
1 void(string...)   print  = #1;
2 string(float)     ftos   = #2;
3
4 void nbva(float a, string...count) {
5     print("You gave me ", ftos(count), " additional parameters\n");
6     print("First: ", ...(0, string), "\n");
7     print("You chose: ", ...(a, string), "\n");
8     for (a = 0; a < count; ++a)
9         print("Vararg ", ftos(a), " = ", ...(a, string), "\n");
10 }
11
12 void main() {
13     nbva(1, "Hello", "You", "There");
14 }