Advertisement
bytecoded

Circular Refs

Nov 10th, 2019
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. &AtClient
  2. Procedure MakeCircularRefs(Command)
  3.  
  4. AttachIdleHandler("MakeCircularRefsAtClient", 1);
  5.  
  6. EndProcedure // MakeCircularRefs()
  7.  
  8. &AtClient
  9. Procedure MakeCircularRefsAtClient() Export
  10.  
  11. MakeCircularRefAtServer();
  12.  
  13. EndProcedure // MakeCircularRefsAtClient()
  14.  
  15. &AtClient
  16. Procedure MakeCircularRef(Command)
  17.  
  18. MakeCircularRefAtServer()
  19.  
  20. EndProcedure // MakeCircularRef()
  21.  
  22. &AtServer
  23. Procedure MakeCircularRefAtServer()
  24.  
  25. S1 = New Structure("S2Ref");
  26. S2 = New Structure("S1Ref");
  27.  
  28. S1.S2Ref = S2;
  29. S2.S1Ref = S1;
  30.  
  31. S2 = Undefined;
  32.  
  33. If
  34. CheckScriptCircularRefs
  35. And CheckScriptCircularRefs().Count() > 0 Then
  36.  
  37. Message = New UserMessage();
  38. Message.Text = "There are circular refs!";
  39.  
  40. Message.Message();
  41.  
  42. EndIf;
  43.  
  44. EndProcedure // MakeCircularRefAtServer()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement