c limitations
: does dink support c-stuff like #include or creating a hheap?
No, DinkC doesn't support C/C++ stuff, so you can't do those things. You can't even do a for loop, you also can't do complicated math, can't return values and other things like that, so you're limited to simple scripting.
No, DinkC doesn't support C/C++ stuff, so you can't do those things. You can't even do a for loop, you also can't do complicated math, can't return values and other things like that, so you're limited to simple scripting.

: : does dink support c-stuff like #include or creating a hheap?
: No, DinkC doesn't support C/C++ stuff, so you can't do those things. You can't even do a for loop, you also can't do complicated math, can't return values and other things like that, so you're limited to simple scripting.
The scripting you CAN do does allow you to do almost anything you like in Dink with the exception of some hardcoded stuff. A for loop isn't possible, but you can work around it, naturally.
: No, DinkC doesn't support C/C++ stuff, so you can't do those things. You can't even do a for loop, you also can't do complicated math, can't return values and other things like that, so you're limited to simple scripting.

The scripting you CAN do does allow you to do almost anything you like in Dink with the exception of some hardcoded stuff. A for loop isn't possible, but you can work around it, naturally.
: The scripting you CAN do does allow you to do almost anything you like in Dink with the exception of some hardcoded stuff.
True, that's why DinkC is a scripting language to create D-Mods, not a massive programming language.
: A for loop isn't possible, but you can work around it, naturally.
Yeah, but other things like complicated math would've been handy
True, that's why DinkC is a scripting language to create D-Mods, not a massive programming language.
: A for loop isn't possible, but you can work around it, naturally.
Yeah, but other things like complicated math would've been handy

January 31st 2003, 03:39 AM

Ivan


But what about declaring pointers to a heap so you can make your own '&story' for example
: But what about declaring pointers to a heap so you can make your own '&story' for example
Well, in DinkC, variables are not reference parameters like in C++. Every variable in DinkC should have an ampersand (&
. You can't do something simple like this:
void change(float &x, float &y)
{ float w = x;
x = y;
y = w;
}
That's C++, but int DinkC every variable, global or local, should have an &. To create a local variable in a script, you can do:
int &_a;
Local variables can only be used in that script, globals can be used anywhere. To create a global variable, we usually create them in main.c:
make_global_int("&story", 0);
DinkC is a simple language and many things common in C++ can't be done in DinkC. Also, you can't include other files like .h files, DinkC scriptfiles are .c and they can be compiled to .d but that's not necessary.
Well, in DinkC, variables are not reference parameters like in C++. Every variable in DinkC should have an ampersand (&

void change(float &x, float &y)
{ float w = x;
x = y;
y = w;
}
That's C++, but int DinkC every variable, global or local, should have an &. To create a local variable in a script, you can do:
int &_a;
Local variables can only be used in that script, globals can be used anywhere. To create a global variable, we usually create them in main.c:
make_global_int("&story", 0);
DinkC is a simple language and many things common in C++ can't be done in DinkC. Also, you can't include other files like .h files, DinkC scriptfiles are .c and they can be compiled to .d but that's not necessary.

: : But what about declaring pointers to a heap so you can make your own '&story' for example
: Well, in DinkC, variables are not reference parameters like in C++. Every variable in DinkC should have an ampersand (&
. You can't do something simple like this:
: void change(float &x, float &y)
: { float w = x;
: x = y;
: y = w;
: }
: That's C++, but int DinkC every variable, global or local, should have an &. To create a local variable in a script, you can do:
: int &_a;
: Local variables can only be used in that script, globals can be used anywhere. To create a global variable, we usually create them in main.c:
: make_global_int("&story", 0);
: DinkC is a simple language and many things common in C++ can't be done in DinkC. Also, you can't include other files like .h files, DinkC scriptfiles are .c and they can be compiled to .d but that's not necessary.
You can't have unlimited variables, however. You can have about 250 (more or less) globals. You can't go over this number with local variables either, if they're used simultaneously.
: Well, in DinkC, variables are not reference parameters like in C++. Every variable in DinkC should have an ampersand (&

: void change(float &x, float &y)
: { float w = x;
: x = y;
: y = w;
: }
: That's C++, but int DinkC every variable, global or local, should have an &. To create a local variable in a script, you can do:
: int &_a;
: Local variables can only be used in that script, globals can be used anywhere. To create a global variable, we usually create them in main.c:
: make_global_int("&story", 0);
: DinkC is a simple language and many things common in C++ can't be done in DinkC. Also, you can't include other files like .h files, DinkC scriptfiles are .c and they can be compiled to .d but that's not necessary.

You can't have unlimited variables, however. You can have about 250 (more or less) globals. You can't go over this number with local variables either, if they're used simultaneously.