tanabi

editor sample code

Aug 30th, 2024
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. $include $lib/editor
  2. $include $lib/lmgr
  3.  
  4. : sample ( -- )
  5. ( You load the editor with a stackrange. If you are starting from scratch: )
  6. 0 editor
  7. ( Or if you are loading a property named 'whatever/list#' from #12345 you would do: )
  8. "whatever/list" #12345 lmgr-fullrange lmgr-getrange editor
  9. (^ NOTE: no # here )
  10. ( The editor will leave whatever command the user used to get out of the editor on
  11. top of the stack. This will be either 'a' for abort or 'e' for end [save]. I
  12. check like this:
  13. )
  14. "a" 1 strncmp not if
  15. popn ( clean stack )
  16. exit
  17. then
  18.  
  19. ( At this point, we want to save what we have. We must first delete what's
  20. already there because lmgr is stupid otherwise
  21. )
  22. #12345 "whatever/list#" remove_prop
  23. (^ NOTE: yes # here )
  24. ( Then save it )
  25. 1 "whatever/list" #12345 lmgr-insertrange
  26. (^ NOTE: no # here )
  27. ;
  28.  
Advertisement
Add Comment
Please, Sign In to add comment