Thursday, June 4, 2015

How to freeze your computer using Microsoft Dynamics NAV

Total credit for this should goes to one of my team members, 

You need to write a very small code to achieve this. 
warning : Once you execute below code, you might have to manually restart the computer, so think twice before executing.

 MyRec.RESET;   
  IF MyRec.FINDFIRST THEN REPEAT   

  UNTIL FALSE;  
Seacret of this remains in the last line of the code. 
In compilers view last line will look like below


 UNTIL (IF Value = TRUE);  

That means loop will get executed as long as condition output value is false, and as the condition gets true, compiler will jump out of the loop and execute the rest of the code. 

If we provide a condition which will never going to get true, then this will turn into a infinite loop and will result in using all the resource available in the computer. 

This is a very small fact and just wanted to share, since it is bit interesting. 

Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekar

No comments:

Post a Comment