Beginner Help

Coordinator
Jan 9, 2012 at 7:46 AM
Edited Feb 14, 2012 at 11:28 AM

Here's some help for a beginner to start understanding web programming and ActiveVFP:

On http://thetechconsult.com/demo/default.aspx ,
everyplace you see the 'View Source', you can click on that and see the VFP code in the html wherever you see <% ...vfp code %> . I think there's a 'view source' for all the examples. You can also see the 'Debug Dump' for each link on that page by turning 'on' the debug dump feature which also lists the major commands:
oRequest.QueryString("yourvariable")
oRequest.FORM("yourvariable")
oSession.VALUE("yourvariable")
oRequest.cookies("yourvariable")
oRequest.ServerVariables("yourvariable")

So basically there are just 2 objects to learn: oRequest and oSession (these are the Classic ASP objects so any good book or tutorial on Classic ASP would probably help too)

Check out the FAQ: http://activevfp.codeplex.com/discussions/277623

Some very basic code shows similarity with basic ASP.NET and PHP:

<%= ****hello.avfp**** %>
Hello world from
<%=version()%>
<%=DATE()%>  <%=Time()%>
<%=IIF(ISNULL(oRequest.Querystring("name")),[hello from the fox],[hello from ]+ oRequest.Querystring("name")) %>


-----


<%-- hello.aspx - this is really basic asp.net, nothing fancy--%>
Hello world from .NET version <%=System.Environment.Version.ToString() %>
<%=now()%>
<%if Request.QueryString("name") <> "" then %>
hello from <%=Request.QueryString("name")%>
<%else%>
hello from ASP.NET
<%end if%>


-----

<?php /* php hello.php */  ?>
Hello world from PHP version
<?php echo phpversion() ?>
<?php echo date('l jS \of F Y h:i:s A') ?>
Hello from
<?php
if (!empty($_GET['name']))
   echo $_GET['name'];
else
   echo "PHP";  
?>


RESULTS------------------------------------------------------------------------------------------------------------------------------------------------------
http://localhost/5.6test/hello.avfp?name=bob
returns:

hello world from
Visual FoxPro 09.00.0000.5815 EXE Support Library for Windows
01/02/12 14:18:33

hello from bob

-------------------

http://localhost/5.6test/hello.aspx?name=bob
returns:

Hello world from .NET version 4.0.30319.239
1/2/2012 2:19:05 PM

hello from bob

------------------

http://localhost/5.6test/hello.php?name=bob
returns:

hello world from PHP version 5.3.8
Monday 2nd of January 2012 02:27:17 PM

Hello from bob