This is also possible, but then we’ll need to use custom tokens.
First things first, create a library for the functions we need: store and retrieve data.
/* Custom Token Library script
void SetCustomTokenEx(int iToken, string sValue)
Sets the custom token identified by the number in iToken to the string value specified in sValue. Also duplicates the value as a
local string stored on the module object so the GetCustomTokenEx function can retrieve it at any time.
string GetCustomTokenEx(int iToken)
Retrieves the current value of the custom token identified by the number in iToken by reading the local string variable containing
the duplicated token value which was stored on the module object by the SetCustomTokenEx function. If the custom token was set using
the default SetCustomToken function instead of SetCustomTokenEx, this function may return an incorrect or blank string.
*/
// Custom Token Constants
const int TKN_BASE = 6000;
void SetCustomTokenEx(int iToken, string sValue)
{
if (iToken <= 0) return;
// Change the custom token variable and duplicate it.
SetCustomToken(iToken, sValue);
SetLocalString(GetModule(), “CUSTOM” + IntToString(iToken), sValue);
}
string GetCustomTokenEx(int iToken)
{
if(iToken <= 0) return “”;
// Return the content of the module variable being used to duplicate the token variable.
return GetLocalString(GetModule(), “CUSTOM” +IntToString(iToken));
}
Note:
TKN_BASE is a constant to set where our numbering will start. Use whatever you want, as long as it’s higher than 1000 (CUSTOM0 etc… are used by the engine for some messages).
All you have to do now is, in your “gui_[script called from OK]”, set the CUSTOM6000 variable:
SetCustomTokenEx(TKN_BASE, strRep); // or whatever name you used for the variable for storing the answer typed in DisplayInputBox.
Don’t forget #include “LibCustomToken” (or whatever you called it)
Afterwards, in your dialog, just use (with the number matching TBN_BASE of course)