Jump to content
Aquablue

'Internal error (20)' When Using Exit(True)

Recommended Posts

Hello all, I just registered at the forum after lurking about for several weeks. My question concerns calling Exit within a function to return a value (True in this case, the function is supposed to return a boolean). When I try to compile the script it fails, and the debug window reports 'Internal error (20)'. This happens regardless of at which line the code is placed.

 

For the moment I used Result := True; followed by Exit; which also works, but calling Exit(True) seems much more elegant to me. Is there any fix for this error?

Link to comment
Share on other sites

As far as I know. You can't pass a value to Exit;. It's not used for results or returns.

 

Exit; is a Flow Control statement, used to exit the function that's currently executing.

 

Break, Continue, Exit are all flow control statements. They usually don't have anything to do with that. If anything you might be able to put a number after them e.g. Break 3; to indicate how many loops or w/e you want to break out of.

Link to comment
Share on other sites

From my experience with Pascal, you can include an argument with Exit; so that when you call it from within a function, the function stops and also returns the value you specified in Exit(). I guess this hasn't been implemented in SCAR?

Link to comment
Share on other sites

From my experience with Pascal, you can include an argument with Exit; so that when you call it from within a function, the function stops and also returns the value you specified in Exit(). I guess this hasn't been implemented in SCAR?

 

The engine SCAR 3 uses does not support this feature, no.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...