Difference between revisions of "Example datanavigation rsp"

From Lianjapedia
Jump to: navigation, search
(Created page with "==Name== ''example.rsp'' ==Description== ==Code== <code lang="recital"> <%@ Language=VFP %> <html> <body> <% // Open the database open database southwind ? "<br>" //...")
 
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Name==
+
{{DISPLAYTITLE:LianjaScript Server Page Example}}
''example.rsp''
+
Example [[Visual FoxPro Server Pages|LianjaScript Server Page (.rsp)]] demonstrating basic data navigation.
 
+
==Description==
+
 
+
  
 
==Code==
 
==Code==
Line 12: Line 9:
 
<body>
 
<body>
 
<%
 
<%
// Open the database
+
    // Open the database
open database southwind
+
    open database southwind
? "<br>"
+
    ? "<br>"
 
 
// Use the table
+
    // Open the table
use customers
+
    use customers
 
 
// Display the data in a table
 
? "<table>"
 
? "<tr>"
 
for i = 1 to fcount()
 
? "<td>" + field(i) + "</td>"
 
next
 
? "</tr>"
 
scan
 
? "<tr valign='top'>"
 
for i = 1 to fcount()
 
? "<td>"
 
? &(field(i))
 
? "</td>"
 
next
 
? "</tr>"
 
endscan
 
use
 
close databases
 
? "</table>"
 
 
%>
 
%>
 +
<table>
 +
<tr>
 +
<%
 +
    // Display the table headings
 +
    for i = 1 to fcount()
 +
        ? "<td>" + field(i) + "</td>"
 +
    next
 +
%>
 +
</tr>
 +
<%
 +
    // Display the data in a table
 +
    scan
 +
        ? "<tr valign='top'>"
 +
        for i = 1 to fcount()
 +
            ? "<td>"
 +
            ? &(field(i))
 +
            ? "</td>"
 +
        next
 +
        ? "</tr>"
 +
    endscan
 +
    // close the table and the database
 +
    use
 +
    close database
 +
%>
 +
</table>
 
</body>
 
</body>
 
</html>
 
</html>
 
</code>
 
</code>
[[Category:CodeExamples]]
+
[[Category:VisualFoxProCodeExamples]]

Latest revision as of 04:40, 29 April 2024

Example LianjaScript Server Page (.rsp) demonstrating basic data navigation.

Code

<%@ Language=VFP %>
<html>
<body>
<%
    // Open the database
    open database southwind
    ? "<br>"
 
    // Open the table
    use customers
 
%>
<table>
<tr>
<%
     // Display the table headings
    for i = 1 to fcount()
        ? "<td>" + field(i) + "</td>"
    next
%>
</tr>
<%
    // Display the data in a table
    scan
        ? "<tr valign='top'>"
        for i = 1 to fcount()
            ? "<td>"
            ? &(field(i))
            ? "</td>"	
        next
        ? "</tr>"
    endscan
    // close the table and the database
    use
    close database
%>
</table>
</body>
</html>