February 4, 201511 yr comment_161613 [attachment=4487:foreach_quest_bar_rpcq.png]\ The warning/error is not produced when atleast one clickie is clicked. This is probably because foreach doesn't know how to handle zero things. I propose a solution: try { //foreach stuff here } catch (Exception $e) { echo "You need to click the checkboxes next to the clickies you wish to maintain."; } Report
February 4, 201511 yr Root Admin comment_161616 foreach_quest_bar_rpcq.png\ The warning/error is not produced when atleast one clickie is clicked. This is probably because foreach doesn't know how to handle zero things. I propose a solution: try { //foreach stuff here } catch (Exception $e) { echo "You need to click the checkboxes next to the clickies you wish to maintain."; } For those interested, the proper solution is: //Checks to make sure $data is an array before iterating if(is_array($data)) { foreach($data as $d) { //do somethign with $d } } Report
February 4, 201511 yr comment_161628 Because, regardless of the language, exceptions are expensive. Of course, depending on the language, *cough*MaxScript*cough* returns, breaks, and continues can also be expensive... (for some absurd reason Autodesk implemented them using C++ exceptions internally) Report
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.