Visual Basic
If MyValue = 5 or _
MyValue = 9 or _
MyValue = 40 Then
'action
End if
C++
if (MyValue == 5 || _
MyValue == 9 || _
MyValue == 40)
{
//action
}
How do I use the _ equivalent in C/C++ ?
C syntax help. Continue a statement into the next line.
Débuté par
JackFuzz
, janv. 30 2010 03:22
#1
Posté 30 janvier 2010 - 03:22
#2
Posté 30 janvier 2010 - 03:30
I figured it out.
It's one backslash instead of an underscore.
... Now if I can only figure out how to make a function that accepts a parameter being passed to it.
It's one backslash instead of an underscore.
... Now if I can only figure out how to make a function that accepts a parameter being passed to it.
Modifié par JackFuzz, 30 janvier 2010 - 03:32 .
#3
Posté 30 janvier 2010 - 05:02
Don't use either. If you can separate them with a space or tab, you can separate them with a newline just as well for anything I can think of in DAScript right now (except #ifdef probably or certain other preprocessor things). The backslash would normally be used in C or C++ if creating a multiline #define macro, which doesn't seem possible to do in Dragon Age's scripting language anyway.
I don't really see it hurting anything if you do, but it's unnecessary and not a good habit to get into - it screams of VB.
I don't really see it hurting anything if you do, but it's unnecessary and not a good habit to get into - it screams of VB.
Modifié par FollowTheGourd, 30 janvier 2010 - 05:43 .
#4
Posté 30 janvier 2010 - 03:03
a function? as in void main() {...} ?
if that is what you are talking about try :
void MyFunction(event ev, int number, etc.) {...}
and when you call it its
MyFunction(EVENT_TYPE_X, 1084, etc.);
*i believe,
if that is what you are talking about try :
void MyFunction(event ev, int number, etc.) {...}
and when you call it its
MyFunction(EVENT_TYPE_X, 1084, etc.);
*i believe,
#5
Posté 30 janvier 2010 - 08:11
Line breaks are ignored by the compiler. You can split lines anywhere you want. The semi-colon is the terminator, not the line break.
EDIT: I should say line breaks are the same as spaces or tabs or any other white space. It is a separator, not a terminator, if that makes sense.
EDIT: I should say line breaks are the same as spaces or tabs or any other white space. It is a separator, not a terminator, if that makes sense.
Modifié par FalloutBoy, 30 janvier 2010 - 08:12 .





Retour en haut






