Quantcast
Channel: Home of ActiveVFP - Foxpro on the World Wide Web
Viewing all articles
Browse latest Browse all 1109

New Post: Struggling with Activevfp

$
0
0
Yes.. Our basic problem is not having the tracing feature.

I too faced the problem with tracing my code. However, I did not intend to use MVC ( i.e. Only POST and sessions are allowed due to security concerns Its silly but I don’t make rules) so my problem was relatively easy to solve. Also, I haven't used classes unless they are packaged into an 'Exe', never to be changed. i.e. are system development tool, and not as application development tools. It just takes longer to debug with classes due to re-starts.

I did my tracing outside the AVFP page. It’s little convoluted but effective. The basic law is that I live and die in one page only. All the common set procedure to (database connections, calling data from SQL server, setting variables etc etc) are in the page 'header'. Page specific VFP code goes after the </header> and before the <body> in the form of a separate ‘code behind’ prg file ( another set procedure to).. and all the variables/procedures are released in the footer. Client side JS is not used at this time.

This now allows me to create the ‘test’ page in VFP itself as follows

I create a prog in VFP which has all the set procedure to.. additives. I then I develop the entire VFP page in this stand alone prg. This is the reverse of what happens in AVFP page. i.e. the HTML is now in embedded strings.

For oProp, oSession, oRequest etc used inside the actual page.. I create them with Createobject(“empty”) and feed them the values (expected in the actual page), at the start of this development prog. Also have a good error handler that releases the procedures apart from displaying error msg.

Since this is a simple PRG, I run it under VFP and do the trace of the HTML being built, line by line. At the end I dump the sting into a temp folder with HTML extension and call Chrome on it. I never get the control positions right (also no CSS) nor do I intend to.

It is not failsafe. I have lost time when I could switch data session from this development/testing program, but the PDF component did not allow changing data sessions in AVFP page ( under IIS).

You may also have to set procedure to ‘prg’ files of ActiveVFP. I don't. I actually duplicate or re-create them outside, in my common program.

It may seem more time consuming, but my productivity is much better.

Viewing all articles
Browse latest Browse all 1109


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>