any ideas?
thanks!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Code: Select all
put the script of card "theCardRef" into tScript
--edit tScript
set the script of card "theCardRef" to tScriptCode: Select all
set the top of graphic "backStars" to the top of graphic "backStars" + the cWarpFactor of this cardCode: Select all
set the script of yourControl to someContainerThis is much simpler to do by monitoring the status of the user. That can be done in many ways, and need never have to go down the path of modifying the actual handler itself. Consider a button and a field on a new card. In the button script:if the user reaches level 2 i want to change some things in the script, for example speed
Code: Select all
on mouseUp
put "abcdef" into dataSet
repeat with y = 1 to 30
put any char of dataSet into fld 1
wait 10 with messages
if y = 15 then
put "CHANGEOVER" into fld 1
wait 20
put "123456" into dataSet
end if
end repeat
end mouseUpAnyway, we are all good. There is no need for the OP to even think down that path."You CAN change the script of an object on the fly, but there's very little likelihood that you would need to.
ok thanks but can i change only a line of the script?SparkOut wrote: Mon Dec 20, 2021 12:14 am Yes you can.
But you probably don't need to.
You canCode: Select all
put the script of card "theCardRef" into tScript --edit tScript set the script of card "theCardRef" to tScript

Sef-modifying code is more expensive to maintain, and usually not necessary.dunbarx wrote: Mon Dec 20, 2021 3:13 pm But any thoughts on self-modifying code in an xTalk in general?
I agree completely. I have never even wished for it, never having needed it. i was just musing based on the OP comments.and usually not necessary.