DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Ask For File, Allow Default And Auto-suffix

01.22.2006
| 713 views |
  • submit to reddit
        
    ; Maybe use refinements for default and suffix rather than
    ; requiring them.
    ask-for-file: func [prompt default suffix /local answer result] [
        change-suffix to file!
            either empty? answer: ask prompt [default][answer] suffix
    ]