ID:147519
 
In one of my curent projects, the compiler keeps on telling me that it expects an expression after various lines in a
switch()
proc. I'm fairly sure that the lines it mentions do have expressions, and I can't find anything wrong with them.

Here's the code:
switch(effects)
if(1) DoPhysDmg(defender,(variables*rand(50,150)*((attacker.insanity*attacker.level/defender.insanity)/100)))
if(2) DoMagcDmg(defender,(variables*rand(50,150)*((attacker.insanity*attacker.level/defender.insanity)/100)))
if(3) DoFireDmg(defender,(variables*rand(50,150)*((attacker.insanity*attacker.level/defender.insanity)/100)))
if(4) DoWatrDmg(defender,(variables*rand(50,150)*((attacker.insanity*attacker.level/defender.insanity)/100)))
if(5) DoWindDmg(defender,(variables*rand(50,150)*((attacker.insanity*attacker.level/defender.insanity)/100)))
if(6) DoErthDmg(defender,(variables*rand(50,150)*((attacker.insanity*attacker.level/defender.insanity)/100))) //This line and the above do not cause the error.
if(7) RstrHlth(attacker,(variables*rand(50,150)*((attacker.insanity*attacker.level)/100)))
if(8) DrinHlth(attacker,defender,(variables*rand(50,150)*((attacker.insanity*attacker.level/defender.insanity)/100)))
if(9) DrinMp(attacker,defender,(variables*rand(50,150)*((attacker.insanity*attacker.level/defender.insanity)/100)))
if(10) BsstAtk(attacker,(variables[1]*rand(50,150)*((attacker.insanity*attacker.level)/100)),variables[2]) // This line doesn't give the error
if(11) BsstDef(attacker,(variables[1]*rand(50,150)*((attacker.insanity*attacker.level)/100)),variables[2]) // This line doesn't give the error
if(12) LowrAtk(defender,(variables[1]*rand(50,150)*((attacker.insanity*attacker.level/defender.insanity)/100)),variables[2])
if(13) LowrDef(defender,(variables[1]*rand(50,150)*((attacker.insanity*attacker.level/defender.insanity)/100)),variables[2])
if(14) DrinAtk(attacker,defender,(variables[1]*rand(50,150)*((attacker.insanity*attacker.level/defender.insanity)/100)),variables[2])
if(15) DrinDef(attacker,defender,(variables[1]*rand(50,150)*((attacker.insanity*attacker.level/defender.insanity)/100)),variables[2])
if(16) Paralyze(defender,variable) // This line doesn't give an error
if(17) Poison(defender,variable[1],variable[2])
if(18) Sleep(defender,variable)
if(19) Sanity(defender,variable)
if(20) Doomed(defender,variable)
if(21) InstDth(defender,variable)
if(22) RemvStts(attacker)
if(23) RndStts(defender,variable[1],variable[2])
variables*rand(50,150)

variables is a list, isn't it?
In response to Garthor
Yes, actually. But it sometimes only holds one item. I'll try altering that referencesand seeing what happens.

Altering that doesn't change a thing. Also, there are errors on some of the lines that don't have a reference to variables anywhere near them.

All of the errors are associated with a certain set of procedures I've defined, if that helps.

EDIT:

I managed to fix it. Turns out I had some definitions (using #define) that were named the same as the procs.
In response to Jp
That big switch statement hurts my eyes. Ow. And also, if you want to put a short phrase into the same font as the DM tags do, use TT tags.