યજમાન તમારા પોતાના બોટ પ્લેટફોર્મ સાથે આ બોટ કાવ્ય Enterprise બોટ પ્લેટફોર્મ
Self, AIML, and scripting

global variable that can be reached in any of the bot's templates

દ્વારા amilsalis પોસ્ટ Oct 24 2019, 19:22

Pardon me for the basic question,but here we go:

Im trying to define a global variable in a self script that I can access in the bot´s response templates. I was searching the scripts but couldnt find, at least in a way it works. Im probably missing something.  I've tried something like the code below:

state MyScript {
    pattern "create variable" template createIt();

    function createIt() {
        #myVar="whatever in it";
    }
}

Then Im trying to use {#myVar}, for example, in some response definition like this {#myVar}. Please could you tell me how could it be done and what Im doing wrong?

Thank you in advance !

Silas


by admin posted Oct 25 2019, 7:25
Symbols are global, but the symbol is an object, so you need to set a property.

i.e.
#myVar.value = "whatever in it";

Thumbs up: 1, thumbs down: 0, stars: 5.0
Views: 1749, today: 0, week: 2, month: 19

ને: 29761580
ટૅગ્સ: self, variables, symbols, globals
પોસ્ટ: Oct 24 2019, 19:22
જવાબો: 1
જોવાઈ: 1736, આજે: 1, સપ્તાહ: 3, મહિને: 25
0 0 0.0/5