valenfor
Joined: 26 Feb 2005 Posts: 20
|
Posted: Tue May 03, 2005 8:27 pm Post subject: Function error - I gotta have a typo... |
|
|
Given this function below, this is included at the top of my main script. This file has ONLY functions and global variables (defined outside of function). No lables are used in this file that contains this function.
When executing my program it always gives:
Error: Return's parameter should be blank except inside a function.
Line#400: Return 0
Checked functions above and below and commented this one out etc but seem to be getting this error a lot in my last few tests.
| Code: | ; This one will load, save or delete a ability record.
dataAbilUpdate(mode, confirm)
{
; required to set paths
global fAbilitiesData
; the structure as it is now.
global g_AbilName
global g_AbilDesc
global g_AbilCastTime
global g_AbilRecoveryTime
global g_AbilRecastTime
global g_AbilEffects
; check the mode to see what to do
if(mode = "load")
{
IniRead, g_AbilDesc, %fAbilitiesData%, %g_AbilName%, AbilDesc
IniRead, g_AbilCastTime, %fAbilitiesData%, %g_AbilName%, AbilCastTime
IniRead, g_AbilRecoveryTime, %fAbilitiesData%, %g_AbilName%, AbilRecoveryTime
IniRead, g_AbilRecastTime, %fAbilitiesData%, %g_AbilName%, AbilRecastTime
IniRead, g_AbilEffects, %fAbilitiesData%, %g_AbilName%, AbilEffects
Return 0
}
else if (mode = "save")
{
IniWrite, %g_AbilDesc%, %fAbilitiesData%, %g_AbilName%, AbilDesc
IniWrite, %g_AbilCastTime%, %fAbilitiesData%, %g_AbilName%, AbilCastTime
IniWrite, %g_AbilRecoveryTime%, %fAbilitiesData%, %g_AbilName%, AbilRecoveryTime
IniWrite, %g_AbilRecastTime%, %fAbilitiesData%, %g_AbilName%, AbilRecastTime
IniWrite, %g_AbilEffects%, %fAbilitiesData%, %g_AbilName%, AbilEffects
Return 0
}
else if (mode = "delete")
{
; are we really deleting?
if (confirm > 0)
{
; here we need to send up a confirmation msgbox and
; only delete if set to true.
}
else
{
IniDelete, %fAbilitiesData%, %g_AbilName%
Return 0
}
}
Return 1
} |
|
|