Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Knox on Wed 25/08/2010 20:26:05

Title: Import a function with paremeters in .ash and Autocomplete **SOLVED**
Post by: Knox on Wed 25/08/2010 20:26:05
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:

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--->
(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)"?

Title: Re: Import a function with paremeters in .ash and Autocomplete
Post by: monkey0506 on Wed 25/08/2010 20:45:10
import void updateConfirmBox(int iSpriteTitle, int iSpriteQuestion);

Works fine. I've done this with every module I've released.
Title: Re: Import a function with paremeters in .ash and Autocomplete **SOLVED**
Post by: Knox on Wed 25/08/2010 22:00:12
Actually you're right, it does work now...I must have generated another error for something else and fixed it since then...:P
Title: Re: Import a function with paremeters in .ash and Autocomplete **SOLVED**
Post by: monkey0506 on Wed 25/08/2010 23:11:03
Based on the error you're describing it sounds like you were trying to do:

// DOES NOT WORK; THIS CODE IS INVALID

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


Anyway, glad you got it sorted. ;)