de en es fr
Let the machine help
Light teasing, exhibition, BDSM, sissyfication, watersports... with sounds and pictures


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Script halts on particular code
PostPosted: Thu Nov 05, 2020 1:06 pm 
Offline
Addict
There is an issue where if you try and getRandom from something set by lets say Math.round the code will halt and not even output an error.
Was running a script, and kept wondering why it was halting for no reason, no error or anything.

Code:
show('Testing Started');

def myVariableA = (2 * 1800 / 3600);
showButton('I got here #1');

def myVariableB = Math.round(2 * 1800 / 3600);
showButton('I got here #2');

def myVariableC = getRandom(1);
showButton('I got here #3')

def normalIntClass = 1;

show(myVariableA + " myVariableA:" + myVariableA.getClass() + " myVariableB:" + myVariableB.getClass() + " myVariableC:" + myVariableC.getClass() + " normalIntClass:" + normalIntClass.getClass());
showButton('Showing myVariableA');

//This will work
def myVariableD = getRandom(myVariableA.intValue());
showButton('I got here #4')

//This will fail
def myVariableE = getRandom(myVariableA);
showButton('I got here #5')

//Halts above with no error etc.
def myVariableF = getRandom(myVariableB);
showButton('I got here #6')


_________________
while (!succeed) try();


Top
 Profile Send private message 
 
 Re: Script halts on particular code
PostPosted: Fri Nov 06, 2020 11:40 am 
Offline
Active member
Thank you for highlighting this.

I had seen the same problem of one of my scripts halting without error at an unknown point. I thought it might be some memory problem my computer had when showing buttons, but couldn't find a work-around.

Forcing my getRandom inputs to be integers seems to have solved it.


Top
 Profile Send private message 
 
 Re: Script halts on particular code
PostPosted: Sat Nov 07, 2020 12:13 am 
Offline
Veteran
Same here. I always type cast to int before passing to getRandom.


Top
 Profile Send private message 
 
 Re: Script halts on particular code
PostPosted: Wed Nov 11, 2020 12:01 am 
Offline
Site Admin
User avatar
Indeed, strange bug. Corrected in the next releases.


Top
 Profile Send private message 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010 - 2020
This website uses session cookies only.