Domain problem
Posted: Tue Mar 17, 2015 8:22 am
I'm having trouble initializing an array in one function and then being able to access the array content from another function. Here's an example.
mainCalc is called from a button handler. mainCalc in turn calls initializeIt to initialize myArray[].
mainCalc than calls checkSomething. Unfortunately, the values in myArray that were initialized in initializeIt are not available to the function checkSomething.
I'm using LiveCode build 7.0.3
Any suggestions will be appreciated.
Thanks!
Howard
var sAB
array myArray
var myResult
function initializeIt
put 7 into myArray[1]
put 8 into myArray[2]
put 2 into myArray[3]
end initializeIt
function checkSomething pFreqA,pFreqB
put myArray[2] into sAB
-- write some code
return sAB
end checkSomething
function mainCalc
get initializeIt()
put 4 into sA
put 876 into sB
put checkSomething(sA,sB) into myResult
-- lots of code lines follow
end mainCalc
mainCalc is called from a button handler. mainCalc in turn calls initializeIt to initialize myArray[].
mainCalc than calls checkSomething. Unfortunately, the values in myArray that were initialized in initializeIt are not available to the function checkSomething.
I'm using LiveCode build 7.0.3
Any suggestions will be appreciated.
Thanks!
Howard
var sAB
array myArray
var myResult
function initializeIt
put 7 into myArray[1]
put 8 into myArray[2]
put 2 into myArray[3]
end initializeIt
function checkSomething pFreqA,pFreqB
put myArray[2] into sAB
-- write some code
return sAB
end checkSomething
function mainCalc
get initializeIt()
put 4 into sA
put 876 into sB
put checkSomething(sA,sB) into myResult
-- lots of code lines follow
end mainCalc