Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Articles
Search: 

Scheduling Visual FoxPro tasks
Michel Fournier, April 1, 2006
This article discusses the ability to use Visual FoxPro to schedule a list of tasks to be executed at specific intervals. While there could be the approach of using the Windows Scheduler to execute those tasks, it is always interesting to be able to control everything from within VFP. A small VFP sc...
Summary
This article discusses the ability to use Visual FoxPro to schedule a list of tasks to be executed at specific intervals. While there could be the approach of using the Windows Scheduler to execute those tasks, it is always interesting to be able to control everything from within VFP. A small VFP scheduler can be really useful when you have a series of tasks that should be executed coming in from several applications.
Description
This article discusses the ability to use Visual FoxPro to schedule a list of tasks to be executed at specific intervals.

Introduction

While there could be the approach of using the Windows Scheduler to execute those tasks, it is always interesting to be able to control everything from within VFP. A small VFP scheduler can be really useful when you have a series of tasks that should be executed coming in from several applications. Those tasks can include various processes such as sending emails, making backups of DBF files, processing the automatic renewals of credit card payments at midnight, refreshing the banners on your Web sites and calculating various Web site affiliate payments.

The infrastructure

The idea is to have an application that sits on a server which takes responsibility for all that. This application should be a small framework taking decision on what to do and when. It should be able to read parameters from a file and act accordingly.

I always like the idea of using a Main.ini file so my applications can read the parameters from. This could easily be adjusted to read from the registry, from an XML file or from any other source. The goal is to be able to easily adjust the application parameters, when there would be a need to, without having to recompile the application.

The Main.ini file should contain the generic parameters as well as application specific parameters. For example, a generic parameter could be a temporary directory that can be used by several tasks from various applications while an application specific parameter could be the Url of the domain related to one specific application.

Here is an overview of a Main.ini file:

[System]
SmtpHost=192.168.1.9
Client=http://www.universalthread.com
Cgi=http://www.universalthread.com/wconnect/wc.dll?
Temp=d:\Temp
Timeout=60
Table=4
Email=2
Application=2

[Table]
Table1=d:\Robot\task
Table2=d:\Robot\Robot
Table3=d:\Robot\Backup
Table4=d:\Robot\RemoveFile

[Email]
Email1=d:\Data\UniversalThread\email
Email2=d:\Data\DMA\email

[Application1]
Exe=Universal Thread
Title=Universal Thread
Http=http://www.universalthread.com
Dbf=d:\Data\UniversalThread
Fat=d:\iis\UniversaThread
Backend=1

[Application2]
Exe=Direct Martial Arts
Title=Direct Martial Arts
Http=http://www.directmartialarts.com
Fat=d:\iis\direct martial arts
Cgi=http://www.directmartialarts.com/wconnect/wc.dll?
ClientServer=1
Backend=1
ConnectionString=Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=d:\Data\DMA;
 Exclusive=No;Collate=Machine;NULL=NO;Deleted=Yes;BACKGROUNDFETCH=NO
In that example, the System section contains the generic parameters. Some of those generic parameters contain sub sections such as Table and Email which also contain generic parameters. The Application parameter contains references to sub sections related to applications the scheduler will have to execute tasks from.

So, basically, in that example, the scheduler is responsible to execute tasks from two applications. The first application is for the Universal Thread and the second application is for a new site called Direct Martial Arts. As those applications are not related, they are handled as two different applications. So, we can isolate the business logic in two separate EXEs that would be called by the scheduler. As the scheduler acts as a framework for scheduling processes, we only have to code what is necessary for each task we have to execute and do not have to worry about the scheduling aspect of the infrastructure.

The scheduling table

The scheduling table contains the parameters for each task the scheduling application has to execute. That table is containing tasks for all applications. Thus, a field in each record is used to identify the application. So, if we have 10 tasks for the Universal Thread, they will be executed in sequence. Then, the scheduling application will proceed with the tasks for the Direct Martial Arts site.

This table contains fields which describe the task, the PRG to call, when the task should be executed on so on. Here is the structure of that table:

Field name Type Width Decimal Description
Numero Integer Primary key
AddUser Integer User who created the record
AddDate Datetime Datetime when the record was created
ModUser Integer User who last updated the record
ModDate Datetime Datetime when the record was last updated
Name Character 20 Title of the task that will appear when the task is being executed
All Logical If the task should be executed every minute
Quaterly Logical If the task should be executed every 15 minutes
Hourly Logical If the task should be executed every hour
Daily Logical If the task should be executed at midnight
Function Memo Name of the PRG of the function to call. As long as the PRG or the function is within the scope, this should work.
NoSystem Integer Primary key of the system (Main.ini equivalent such as Application1, Applications2, etc.)

The following provides an overview of a task table:

Some columns have been resized to fit the article spacing. For example, the AddDate and ModDate fields contain the time but they are not shown in this image.

Overview of the scheduling application

While there could be a way to define this scheduling application as a Windows Service, in this article, I will simply consider the application to be launched manually from the desktop. When it is run, it looks like this:

Basically, the application sits on the desktop and waits for execution. The Main.ini file contains a parameter in the System section named Timeout. This is the interval of executing the scheduling monitor process.

Once the interval is reached, the loop of tasks to execute is done. When this is the case, the scheduling application will show the status of the current task being executed:

The scheduling application contains a button to force an immediate process. This is useful when you are on the server and you wish to force the execution of the list of tasks to be executed for testing purposes. Thus, in this case, you will not have to wait for the interval to be reached as the tasks related to the current time will be executed. This means that if the time is 17h00, all the tasks scheduled for All, Quaterly and Hourly will be executed. Assuming 17h34 will be the current time, and you made modification in the code for a task that should be executed on an hourly basis, you would simply have to update the Task.dbf table to check temporary the All field so when you test it, or when the next interval will be reached automatically, that specific task will also be executed. Once the test completed, you may uncheck the All field so that specific task will be executed as scheduled, thus at the next hour.

Generic tasks

There are some generic tasks that do not require an entry in the Task.dbf table. These tasks are common to several applications and can be defined at the higher level of this structure such as in the framework level, thus the scheduling application. Those tasks are responsible for sending emails, making backups and removing temporary files. Other generic tasks can be added based on your own requirements. I have found that over the years, those three are commonly used in all of my applications.

At each interval, additionally to executing the records of the Task.dbf table that are marked as All, I also execute the task of sending emails. As this task is generic, there is no entry in the Task.dbf table. Each application has its own Email.dbf table. Thus, based on the Main.ini file, the location of each of those email tables is known. The scheduling application is then looping on each of them and sending the emails that have to be sent.

Every 15 minutes, additionnaly to executing the record of the Task.dbf table that are marked as Quaterly, I also execute the task of removing temporary files. If applicable, those files are files that other applications will create for a certain period but can be removed after a certain time. One example is a file that can be created on a directory of a Web site for a certain download. Based on the definition of each record in RemoveFile.dbf, the scheduling application knows after which duration each file in a directory has to be deleted.

Here is the structure of the RemoveFile.dbf table:

Field name Type Width Decimal Description
Title Character 100 Title of the task that will appear when the task is being executed
Directory Character 100 Directory to scan for
Timeout Numeric 6 Number of seconds a file is ready to be deleted

The following provides an overview of a RemoveFile.dbf table:

Next, we have a very interesting task. It is the task to backup the application data at midnight. This one uses a COPY TO approach so a backup can be done without interrupting the applications. It may take a little bit longer but this is not a factor as this task is done from the scheduling application. Its role is to copy into a backup directory all application data under its own directory naming convention. Thus, once the process is done, there is always a fresh copy of the data residing in another directory where only DBF are copied. Additionally to that, a Reindex.prg file is created in case reindexation would be needed.

In order to achieve that task, we also need a Backup.dbf table. Its structure is really simple. Only one field is required. Here is it:

Field name Type Width Decimal Description
Directory Character 100 Directory to backup the data from

The following provides an overview of a Backup.dbf table:

As you might have seen, we also backup the Robot directory, which is the directory of the scheduling application. Thus, the Task.dbf, RemoveFile.dbf and Backup.dbf tables are part of the backup process as well.

Quaterly, Hourly and Daily tasks

We need to have some kind of mechanisms to assure that the quarterly, hourly and daily tasks will only be executed once as per their actual timeframe. By that, I mean that a quarterly task should only be executed once per 15 minutes. The same goes with an hourly task which should only be executed once per hour. In order to accomplish task, I have a Robot.dbf table which includes flag for such information.

Here is the structure of the Robot.dbf table:

Field name Type Width Decimal Description
NoSystem Numeric 2 Primary key of the system (Main.ini equivalent such as Application1, Applications2, etc.)
Quaterly Numeric 2 The minute when it was last executed
Hourly Numeric 2 The hour when it was last executed
Daily Date The date when it was last executed

The following provides an overview of a Robot.dbf table:

The application EXE

The scheduling application will call in loop all application EXEs defined in the Main.ini file. In our example, we have two applications to call. Those application role is simply to launch the process of all task by simply calling the ProcessAllTask() function, which is available in the calling EXE, thus the scheduling application. The application can also set up variables that need to be visible in this EXE and so on. We assume that the application contains the functions and/or PRGs that need to be available based on the Task.dbf table definition.

Thus, an application can have a project with Master.prg as the main PRG which can simply contain one line, in its simplest way, thus ProcessAllTask(). The application project would then include the PRGs necessary for all task executions.

So, in memory, the scheduling application is always running. This is a VFP EXE that is launched manually and sits on the desktop. Then, at specific interval, it calls in loop each application EXE defined in Main.ini. So, this is nice because every time you want to update a task or create a new one, you only have to deal with a small project, thus the one you want for such maintenance. This also allows multiple developers to build their own application EXE without knowing anything about the scheduling application. As everything is done in VFP, it also gives you full flexibility on what you want to achieve. It is also possible to update the application EXEs without interrupting the scheduling application as those are sub EXEs being called from the scheduling application. In case of collision, assuming that the interval is being kicked and is in its process of executing the tasks, within a manner of seconds, you should be able to get a handle on the application EXE you wish to update.

Conclusion

This article provided an overview of task scheduling in VFP. I hope it gave you some ideas about implementing such functionalities if you do not already have some.

Source code

It is not possible to include the full source code of the scheduling application. However, it is possible to include the ProcessAllTask() function which provides the core functionality of the scheduling application:

* Process all tasks
FUNCTION ProcessAllTask
LOCAL lnOldSel,lnMinute,lnQuaterly,lnHour
lnOldSel=SELECT()

* Process task for each interval
SELECT Name,Function FROM Task WHERE NoSystem=goRobot.nSystem AND All INTO CURSOR TempTask
ProcessTask()

* Quaterly
lnMinute=MINUTE(DATETIME())
DO CASE
   CASE lnMinute>=0 AND lnMinute<=14
      lnQuaterly=0
   CASE lnMinute>=15 AND lnMinute<=29
      lnQuaterly=15
   CASE lnMinute>=30 AND lnMinute<=44
      lnQuaterly=30
   CASE lnMinute>=45 AND lnMinute<=59
      lnQuaterly=45
ENDCASE
SELECT Robot
SEEK goRobot.nSystem ORDER TAG NoSystem
IF Quaterly<>lnQuaterly
   REPLACE Quaterly WITH lnQuaterly
   SELECT Name,Function FROM Task WHERE NoSystem=goRobot.nSystem AND Quaterly INTO CURSOR TempTask
   ProcessTask()

   * Additionnaly to the quaterly tasks, we have to remove the files
   RemoveFile()

ENDIF

* Hourly
SELECT Robot
lnHour=HOUR(DATETIME())
IF Hourly<>lnHour
   REPLACE Hourly WITH lnHour
   SELECT Name,Function FROM Task WHERE NoSystem=goRobot.nSystem AND Hourly INTO CURSOR TempTask
   ProcessTask()
ENDIF

* Daily
SELECT Robot
IF Daily<>DATE()
   REPLACE Daily WITH DATE()
   SELECT Name,Function FROM Task WHERE NoSystem=goRobot.nSystem AND Daily INTO CURSOR TempTask
   ProcessTask()

   * Additionnaly to the daily tasks, we have to do the backup
   Backup()

ENDIF

SELECT(lnOldSel)


FUNCTION ProcessTask
LOCAL lcExec
SCAN
   Main.StatutClient.Caption=ALLTRIM(Name)
   lcExec=Function
   &lcExec
ENDSCAN
Michel Fournier, Level Extreme Inc.
Michel Fournier is a professional, visionary, perfectionist, mostly known for his renowned realizations over the years, designer, architect, owner of the « Level Extreme Platform », formerly known as the « Universal Thread », recognized as one of the longest running Web sites of the planet, also known as a precursor to social networking, product manager, Internet serial entrepreneur, practiced Lean Startup techniques long before they were known, out of the box thinker, using the tenth man rule, specializes in building entire virtual data center solutions, has provided high end IT consulting worldwide, has owned and operated three companies, delivered worldwide renowned e-commerce Web sites, designed and architected two world class top level development frameworks, wrote over 100 IT articles for various sources, presented at user groups, conventions and corporations nationwide as well as in the US, has provided his contribution in political and legal issues to provide a better world, Owner and Senior IT Consultant at Level Extreme Inc., former Architect Software/Application & Project Manager, 7 times Microsoft Most Valued Professional for VB.NET, 7 times Microsoft Most Valued Professional for Visual FoxPro, Developers Choice award for best site at VFP DevCon 2000 Connections in New Orleans, featured in Acadie Nouvelle on October 2003.
More articles from this author
Michel Fournier, February 1, 2007
From the Level Extreme .NET Framework, this small class allows a developer to manipulate easily the content of a directory by the use of a dataset. With the setup of a few properties, a call to the method and the access to the object dataset, you can have access to the file properties of the directo...
Michel Fournier, August 1, 2001
It is interesting to see how something new can evolve. This is the case for the Universal Thread Magazine. We are now at our 3rd issue and we are already overbooked by scheduled articles and hot stuff we have to cover for the upcoming issues. Publishers are sending request for book reviews, wri...
Michel Fournier, October 1, 2002
UTMag/RapoZine team Editors Michel Fournier Claudio Lassala Co-editor Martín Salías Translation coordinators Claudio Lassala Martín Salías Translators Eduardo Vidigal Rodolfo Duarte Fábio Vazquez José Cavalcanti Moacyr Zalcman Fábio Vieira M...
Michel Fournier, May 1, 2006
In this article, Michel Fournier is providing a small introduction to manipulating XML data from VB.NET. The use of XML is now widely used for various purposes such as exchanging data between application, platforms and other environments. XML is a simple and very flexibile text format that can be ma...
Michel Fournier, October 1, 2001
In our daily things we do, sometimes we find ourselves in unexpected situations. Such situations, either in our personal life or from our professional work, require some adjustments in order to walk through them. The ability to take some time to take an overall look of what is happening, apply a bas...
Michel Fournier, March 1, 2007
In this small article, Michel discusses a problem he recently encountered when converting a dataset into XML to be used later on with a XSL transformation to export into an Excel sheet. When null values were present in the dataset, this was creating weird result. This article provides a quite alte...
Michel Fournier, February 1, 2006
This article discusses a simple banner fonctionalities function which can ease the display of banners on Web sites. If your Web site displays banners in GIF, JPG of Flash format, this function could be useful to you.
Michel Fournier, January 1, 2006
There are various ways to authenticate a user to a Web Service. This article discusses one way to do it by the use of Cookies. As it could the case with a Web page sending a cookie to the browser, the same can be used from within a Web Service.
Michel Fournier, February 1, 2006
This article is a follow up on the first part of this article which appeared on our January 2006 issue. In this one, Michel discussed further implementation of getting the authentication from a members table as well as setting up a session per user.
Michel Fournier, December 1, 2003
Visual FoxPro and .NET are two great environments to build business applications with. But, fantastic they are when you combine them together in order to increase the strenght of the flexibility to respond to your client needs. In this article, I will demonstrate a case study in regards to a new ser...
Michel Fournier, December 1, 2002
Over the years, I have been involved in several types of desktop and Web applications. Every time you start a new project, there is always something new you will learn. In this article, I would like to detail some of the issues which are to be considered when delivering a Web based application. Thos...
Michel Fournier, January 1, 2003
This article is a follow-up with more advanced details in regards to the first article of this series in our December issue which included a tip on dealing with stylesheets. This one allows you to customize your HTML code based on the user, assuming each user has some ways to setup some specific sty...
Michel Fournier, March 1, 2003
The first two articles of this series have been published in the issues of December 2002 and January 2003. In this one, I will talk about graphic issues, how to negotiate with a form to launch his transaction to either within the same window or a new one, how to gather values from one page to anothe...
Michel Fournier, April 1, 2003
In this article, I will proceed with considerations about HTTP server variables being received from a browser and about considerations for opening new windows in your Web application. Relying on the protocol or not When it first started, we didn't ask that question to ourselves as to know ...
Michel Fournier, April 1, 2009
This articles describes the use of CDO.Message to gain the ability to retrieve a URL as a MHT file. It also covers an interesting approach to retrieve a URL even if this one requires a login.
Michel Fournier, January 1, 2006
Data dictionaries has its use and also for Web applications. I see many developers building Web applications who forget about many structured that used to be in place when developping desktop applications. The same should apply for Web applications as it is no different. This article discusses some ...
Michel Fournier, June 1, 2003
DevTeach was held in Montreal from May 10-13, 2003. It presented a new breed of conference. Sessions included both presentation material and, whenever possible, hands-on training. DevTeach brought under the same roof the best speakers available for .NET, SQL Server and Visual FoxPro as well as Micro...
Michel Fournier, May 1, 2002
The Essential Fox conference was held this weekend in Independence, MO. Once again, the Universal Thread team was on site to do the official coverage of the event. It has been a great success, well planned by Russ Swall, the event owner, and his team and well appreciated by the attendees. A total of...
Michel Fournier, April 1, 2002
UTMag/RapoZine team Editors Michel Fournier Claudio Lassala Translation coordinators Claudio Lassala Martín Salías Translators Eduardo Vidigal Rodolfo Duarte Fábio Vazquez Claudio Rola José Cavalcanti Moacyr Zalcman Ricardo Soares Fábio Vieira ...
Michel Fournier, September 1, 2001
Ever wonder how to successfully and rapidly display HTML lists to your users? Well, we all probably already did. However, its implementation differs a lot from sites to sites as we all have our own different approaches. Delivering Visual FoxPro data to the Web as if you would be in Visual FoxPro is ...
Michel Fournier, November 1, 2001
A lot of things happened recently in the Visual FoxPro world and for related technologies. The Great Lakes Great Database Workshop was being held in Milwaukee from Sunday October 27 to Wednesday October 31. That conference which primaly focused on Visual FoxPro has covered a lot of technologies...
Michel Fournier, December 1, 2002
UTMag/RapoZine team Editors Michel Fournier Claudio Lassala Co-editor Martín Salías Translation coordinators Claudio Lassala Martín Salías Translators Eduardo Vidigal Rodolfo Duarte Fábio Vazquez José Cavalcanti Moacyr Zalcman Fábio Vieira M...
Michel Fournier, November 1, 2002
UTMag/RapoZine team Editors Michel Fournier Claudio Lassala Co-editor Martín Salías Translation coordinators Claudio Lassala Martín Salías Translators Eduardo Vidigal Rodolfo Duarte Fábio Vazquez José Cavalcanti Moacyr Zalcman Fábio Vieira M...
Michel Fournier, January 1, 2003
UTMag/RapoZine team Editors Michel Fournier Claudio Lassala Co-editor Martín Salías Translation coordinators Claudio Lassala Martín Salías Translators Rodolfo Duarte Fábio Vazquez Moacyr Zalcman Martín Salías Antonio Castaño Fabián Belo Rafae...
Michel Fournier, November 1, 2001
I have been following several threads on the Universal Thread recently about FTP from Visual FoxPro. I have used an ActiveX for a while to do such a task. I have found that years after years, the problem is that you have to maintain that ActiveX for your own workstation and for every servers or work...
Michel Fournier, July 1, 2002
UTMag/RapoZine team Editors Michel Fournier Claudio Lassala Co-editor Martín Salías Translation coordinators Claudio Lassala Martín Salías Translators Eduardo Vidigal Rodolfo Duarte Fábio Vazquez José Cavalcanti Moacyr Zalcman Fábio Vieira M...
Michel Fournier, January 1, 2006
With the beginning of the new year, Michel resumes some of the highlights of the Universal Thread and what is coming up for the new season.
Michel Fournier, March 1, 2006
When comes time to display the content of a memo field on a Web page, one common task we have to do is to hyperlink specific content. This article discusses about a technique which can be used to hyperlink various types of links as well as email addresses.
Michel Fournier, April 1, 2009
This article describes some basic techniques to manipulate some images in .NET. It covers image resizing, image cropping and the ability to save an image into a JPG high resolution format.
Michel Fournier, May 1, 2007
This short articles provides an approach of important data from an Excel sheet into your application without having the requirement of having Excel installed on the server.
Michel Fournier, August 1, 2002
UTMag/RapoZine team Editors Michel Fournier Claudio Lassala Co-editor Martín Salías Translation coordinators Claudio Lassala Martín Salías Translators Eduardo Vidigal Rodolfo Duarte Fábio Vazquez José Cavalcanti Moacyr Zalcman Fábio Vieira M...
Michel Fournier, July 1, 2001
Recently, I was having problems while working on several projects on my PC. The problems were happening when I had several applications open at the same time. When the problem occured, I had to reboot my PC and then was able to work for a few hours up to a few days until the next reboot. As I was wo...
Michel Fournier, June 1, 2002
UTMag/RapoZine team Editors Michel Fournier Claudio Lassala Co-editor Martín Salías Translation coordinators Claudio Lassala Martín Salías Translators Eduardo Vidigal Rodolfo Duarte Fábio Vazquez José Cavalcanti Moacyr Zalcman Fábio Vieira M...
Michel Fournier, September 1, 2002
UTMag/RapoZine team Editors Michel Fournier Claudio Lassala Co-editor Martín Salías Translation coordinators Claudio Lassala Martín Salías Translators Eduardo Vidigal Rodolfo Duarte Fábio Vazquez José Cavalcanti Moacyr Zalcman Fábio Vieira M...
Michel Fournier, January 1, 2001
Xitech (Europe) produces tools for the Windows software developer. They specialize in FoxPro Developer tools, data and code recovery and security. In this article, we will see an overview of 5 of their tools. You will find more details about each of them from Xitech documentation. To get Xitech cont...
Michel Fournier, April 1, 2006
This article describes an overview of sending an email from VB.NET. It covers the basis of creating the email functionality in a class and using an instance of that class to define and send the email. The class includes the ability to send to multiple recipients as well as sending attachments. Sendi...
Michel Fournier, July 1, 2002
This is a follow up on my previous article on using SOAP protocol for authentication that appeared in our December 2001 issue. That article was mentioning the use of the SOAP header for authentication such as being able to identify the user for any upcoming hit to your Web Service as soon as the Log...
Michel Fournier, May 1, 2002
UTMag/RapoZine team Editors Michel Fournier Claudio Lassala Translation coordinators Claudio Lassala Martín Salías Translators Eduardo Vidigal Rodolfo Duarte Fábio Vazquez José Cavalcanti Moacyr Zalcman Fábio Vieira Martín Salías Antonio Castañ...
Michel Fournier, July 1, 2002
From recent discussions I had, with several persons from my team, about common patterns which occur in the evolution of the Universal Thread, I thought it would be nice to write an article about it. Basically, within the evolution of a product, there are some similitudes which are sometimes interest...
Michel Fournier, June 1, 2001
Welcome to our first issue of the Universal Thread Magazine. We kept receiving many requests to have such a media available on the Universal Thread, so we decided to release our first issue this month. Many people have mentioned an interest to either have such a magazine for the pleasure to read abo...
Michel Fournier, December 1, 2001
The Visual FoxPro Zone evolves As many of you may have seen, the Universal Thread Visual FoxPro Zone is evolving quite fast. In the last month, we added new content in it. As usual, the most popular option is the Toledo Wish List. Several entries are created every day. This is the place to co...
Michel Fournier, January 1, 2002
It's January 3rd, 2002, I am writing this editorial at 20h32 EST. The Christmas break is over but was it really a break? More and more, years after years, I keep seeing a lot of persons online during Christmas day or a few minutes before the new year. And, I mean, they are online as per their own ti...
Michel Fournier, January 1, 2004
In December 1993, a great history started when a small Web site known as the Visual FoxPro Yellow Pages started. Basically, a site providing ads for Visual FoxPro developers such as jobs and consulting services. Known also as the first Visual FoxPro site, it has evolved quite fast during the first t...
Michel Fournier, January 1, 2006
In the recent months, I have been involved in settings various projects at client sites, as well as for Level Extreme Web sites, which involved the support of uploading image files from an Internet browser. The process of supporting that capability in your application, either from a desktop of from ...
Michel Fournier, December 1, 2001
The Microsoft SOAP client provides access to any Web Service. Once the object is instantiated and the location of the WSDL file given, you are ready to go to access any method. Thus, based on what is supported by the Web Service, you can query to obtain various types of content such as string and bo...
Michel Fournier, February 1, 2002
On January 15th, 2002, an important joint took place for our magazine. The Universal Thread Magazine and RapoZine magazine, an online magazine available for the Portuguese developers community, joined to create UTMag/RapoZine. Effective from this issue, both magazines will offer the same technical c...
Michel Fournier, July 1, 2002
Show seconds in a readable format If you need to check elapsed time with seconds() or a datetime value, this function allows you to display the elapsed time in a human-readable format, that is, hours:minutes:seconds, instead of the total number of seconds. Just pass a number of seconds as...
Michel Fournier, August 1, 2002
Updating your DLL on IIS This has been a common question in the recent months on the Universal Thread. More and more, developers have the need to use a DLL under IIS. However, the fun part comes when you need to update it. As soon as it kicks in, you can't update your DLL anymore as it re...
Michel Fournier, November 1, 2002
Use MemLines() to wrap text lines When you need to wrap some text at a given width (say 75 characters per line), you do it easily with: SET MEMOWIDTH TO 75 lcMemo = lcNewMemo = "" _MLINE = 0 FOR i= 1 TO memlines(lcMemo) lcNewMemo = lcNewMemo ; + MLINE(lcMemo,1,_MLINE...
Michel Fournier, September 1, 2002
Getting image width and height Probably the most flexible way to extract the width and height of an image is by the use of the image object. All is needed is to load the image in the object and get the values from the Width and Height properties. LOCAL loImage,lnWidth,lnHeight loIma...
Michel Fournier, October 1, 2002
Extracting BMPs from general fields As a complement with last issue's article on image handling, yo can find useful this little function. If you got convinced that using general fields to handle images is a bad idea, you can decided go back to independent image files. But then you'll...
Michel Fournier, June 1, 2001
It was a year ago. The DevConnections team was holding the Visual FoxPro DevCon 2000, the SQL Server Connections and the DevCon 2000 in New Orleans, Louisiana from May 14 to 18, 2000. For the first time, attendees were able to attend sessions from more than one conference at the same time. This offe...
Michel Fournier, September 1, 2001
Is there a speed limit on the Internet? Probably not, because there is so much things we can do in a short time about delivering various type of content to the community. I remember a week ago we shared an idea about helping the promotion of user group activities around the world. A week ago it was ...
Michel Fournier, March 1, 2002
In the last month, we received dozens of emails from satisfied persons in regards for our initiative of opening the magazine and the Universal Thread in general for additional communities such as the Portuguese and Spanish communities. Regulars members of the Universal Thread, new members, Microsoft...