Import a function with paremeters in .ash and Autocomplete **SOLVED**

Started by Knox, Wed 25/08/2010 20:26:05

Previous topic - Next topic

Knox

Say I have a function "void updateConfirmBox(int iSpriteTitle, int iSpriteQuestion)"

If this function is kept in my global script, when I start typing the function and add the parenthesis, autocomplete gives me a pop-up of what goes inside "(int iSpriteTitle, int iSpriteQuestion)"...

However, if I place the function in another script and import it into the .ash, I have to write it like this:
Code: ags

import void updateConfirmBox(int, int);


If I try to include the int's name, Ill get an error...so how do I write it in the .ash so I dont get an error--->
Code: ags
(cannot define body of imported function)


Id like it when Autocomplete shows me a pop-up of what goes inside the parenthesis, it doesnt just show "(int, int)", but "(int iSpriteTitle, int iSpriteQuestion)"?

--All that is necessary for evil to triumph is for good men to do nothing.

monkey0506

Code: ags
import void updateConfirmBox(int iSpriteTitle, int iSpriteQuestion);


Works fine. I've done this with every module I've released.

Knox

Actually you're right, it does work now...I must have generated another error for something else and fixed it since then...:P
--All that is necessary for evil to triumph is for good men to do nothing.

monkey0506

Based on the error you're describing it sounds like you were trying to do:

Code: ags
// DOES NOT WORK; THIS CODE IS INVALID

import void updateConfirmBox(int iSpriteTitle, int iSpriteQuestion) {
  // ...
}


Anyway, glad you got it sorted. ;)

SMF spam blocked by CleanTalk