home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 01e / let12.zip / DEMO-7.BAT < prev    next >
DOS Batch File  |  1987-09-17  |  1KB  |  34 lines

  1. echo Off
  2. If `%Name%' == `' Demo
  3. cls
  4. echo   ╔════════════════════════════════════════════════════════════════╗
  5. echo ┌─╫────────────────────────────────────────────────────────────────╫─┐
  6. echo │ ║   String Manipulation (part 4): REPLACE                        ║ │
  7. echo └─╫────────────────────────────────────────────────────────────────╫─┘
  8. echo   ╚════════════════════════════════════════════════════════════════╝
  9. set Str=Dear (person): I think you should know that (something)
  10. echo  
  11. echo Now, I have a string of my own, which looks like this:
  12. echo  
  13. echo "%Str%"
  14. echo  
  15. echo and what I want you to do is give me some information, for example,
  16. :AskFor2
  17. LET person=(proper (ask "What name should I fill in for (person)? "))
  18. LET something=(ask "and what should I tell this person? --> you should know that ")
  19. echo  
  20. echo Ok, you said (person) should be replaced by %person% and you want to say
  21. echo %something%
  22. echo  
  23. echo Here goes:
  24. echo  
  25. LET STR=(replace Str   "(person)" person   "(something)" something)
  26. echo We get:
  27. echo %Str%
  28. echo  
  29. set str=
  30. set person=
  31. set something=
  32. pause
  33. DEMO-8
  34.