Using GetFileAsArray()

Contents of data.txt :
New York
Helsinki
Copenhagen
Moscow
Rotterdam

Using GetFileAsArray() to perform fun stuff:







New York Helsinki Copenhagen Moscow Rotterdam 


Contents of default.asp :
<!-- The includefile is one level back from the "default.asp" file: -->
<!--#include file ="../../jakes_IO.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="da">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Example use of the GetFileAsArray function</title>
    <link rel="stylesheet" type="text/css" href="/jake.css">
</head>
<body>
    <div align="center"><h1>Using GetFileAsArray()</h1></div>
    <b>Contents of data.txt :</b><br>
    <div class="data">
    <% response.write(stringToHTML (GetFileContents("data.txt")))%>
    </div>
    
    <!-- ***************    HERE IS WHERE IT HAPPENS!!     ****************** -->
    <p><b>Using GetFileAsArray() to perform fun stuff:</b><br>
    <div class="sample">
    <%     
        dim dropdown, list, links, line
        
        dropdown = "<select name='cities'>"
        list = "<ul>"
        
        for each line in GetFileAsArray("data.txt")
            dropdown = dropdown & "<option>" & line
            list = list & "<li>" & line
            links = links & "<a href='http://www." & line & ".com'>" & line & "</a>&nbsp;"
        next
        
        dropdown = dropdown & "</select>"
        list = list & "</ul>"
    
        response.write(dropdown & "<br><hr><br>")
        response.write(list & "<br><hr><br>")
        response.write(links & "<br><hr><br>")
    %>
    </div>
    <!-- ********************************************************************** -->
    
    <p><b>Contents of default.asp :</b><br>
    <span class="source">
    <% response.write(stringToHTML (GetFileContents("default.asp")))%>
    </span>

</body>
</html>