home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 March / CHIPCD_3_98.iso / software / share / sharmies / unixdos / data.z / translit.m4 < prev    next >
Text File  |  1997-11-18  |  962b  |  24 lines

  1. #-------------- concatinate function
  2. define(CAT,$1$2$3)
  3. #-------------- convert to upper case function
  4. define(UP,`translit($1,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ)')
  5. #-------------- convert to lower case function
  6. define(LOW,`translit($1,ABCDEFGHIJKLMNOPQRSTUVWXYZ,abcdefghijklmnopqrstuvwxyz)')
  7. #-------------- extract first letter function
  8. define(FIRST,`substr($1,0,1)')
  9. #-------------- extract rest after the first letter function
  10. define(REST,`substr($1,1)')
  11. #-------------- Generate name with first letter capital rest lower case
  12. define(NAME,`CAT(UP(FIRST($1)),LOW(REST($1)))')
  13. #-------------- check if input is a number function
  14. define(ISNUM,`ifelse(substr(translit($1,-0123456789,~~~~~~~~~~~),0,1),~,1,0)')
  15. define(ISNUMTXT,'$1' is a `ifelse(ISNUM($1),1,number,text)')
  16. #-------------- applications
  17. ISNUMTXT(18)
  18. ISNUMTXT(text)
  19. UP(YourNameHere)
  20. LOW(YourNameHere)
  21. FIRST(YourNameHere)
  22. REST(YourNameHere)
  23. NAME(YourNameHere)
  24.