Advertisement
Runer112

stralign macros

Jan 20th, 2012
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #macro strlength(str)
  2. #define org_temp eval($)
  3. clr()
  4. wr("#define str \"",str,"\"")
  5. wr("#define strf concat(\"",str,"\")")
  6. run()
  7. .db str
  8. #define strl eval($-org_temp)
  9. .seek org_temp
  10. #endmacro
  11.  
  12. #macro stralignl(str,x)
  13. strlength(str)
  14. stralignlloop(x-strl)
  15. #endmacro
  16. #macro stralignlloop(x)
  17. #if x > 0
  18. #define strf concat("\"",strf," \"")
  19. stralignlloop(x-1)
  20. #endif
  21. #endmacro
  22.  
  23. #macro stralignm(str,x)
  24. strlength(str)
  25. stralignmloop1(x-strl)
  26. #endmacro
  27. #macro stralignmloop1(x)
  28. #if x > 0
  29. #define strf concat("\"",strf," \"")
  30. stralignmloop2(x-1)
  31. #endif
  32. #endmacro
  33. #macro stralignmloop2(x)
  34. #if x > 0
  35. #define strf concat("\" ",strf,"\"")
  36. stralignmloop1(x-1)
  37. #endif
  38. #endmacro
  39.  
  40. #macro stralignr(str,x)
  41. strlength(str)
  42. stralignrloop(x-strl)
  43. #endmacro
  44. #macro stralignrloop(x)
  45. #if x > 0
  46. #define strf concat("\" ",strf,"\"")
  47. stralignrloop(x-1)
  48. #endif
  49. #endmacro
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement