AutoHotkey Community

It is currently May 27th, 2012, 1:19 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: May 3rd, 2005, 9:27 pm 
Offline

Joined: February 26th, 2005, 5:36 am
Posts: 21
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
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 3rd, 2005, 10:00 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
This could be a bug but I'll need some way to reproduce it. Perhaps you e-mail the script(s) to support@autohotkey.com

If you have time, simplify the scripts to be as tiny as possible while still being able to produce the error.

Thanks.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, chaosad, oldbrother, Yahoo [Bot] and 23 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group