Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Poor performance of VFP app on network
Message
From
27/08/2001 10:31:21
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00548615
Message ID:
00549436
Views:
14
>Hilmar
>How do you implement the loader, exactly?
>Jaime
>
>>I thought I didn't want to go into too many details.
>>
>>Of course, the "loader" topic is quite relevant indeed, and I have used a loader for quite a while now.
>>
>>Hilmar.

Jaime,

Every time I compile a version of an EXE, I save it to the network with a different name. First version is "pcp_0001.exe", next version "pcp_0002.exe", etc.

The loader program (included at the end) looks for, and loads, the highest version. Just convert it to an EXE.

This loader program gives me two enormous advantages: 1) I can upgrade while the users work. 2) If I screw the program up, the user can go back to a previous version while I do the repair work.
* Purpose: facilitate software updates (with this program, often it will
* not be necessary for all users to log out).
* This program looks for, and executes, the executable with the highest version number
* (as indicated in the filename)
* Based on a tip (or was it an article?) in FoxPro Advisor.

#DEFINE BASENAME "PCP_"

local lnNumberOfVersions, laExeFileNames(1,1), lnI, lnIndexOfHighest, lnNumberOfHighest,;
	lnCurrentVersionNumber, lcFileName

* Get array with executables
lnNumberOfVersions = adir(laExeFileNames, BASENAME + "*.exe")
if lnNumberOfVersions = 0
	MessageBox("Error: No se encuentra el archivo " + BASENAME + "xxxx.exe.", 16, "Error al cargar el sistema")
	* MessageBox("Error: File not found " + BASENAME + "xxxx.exe.", 16, "Error loading the application")
	return
endif

* Check which one has the highest version number
lnIndexOfHighest = 1
lnNumberOfHighest = 0
for lnI = 1 to alen(laExeFileNames, 1)
	lnCurrentVersionNumber = val(substr(laExeFileNames(lnI, 1), len(BASENAME) + 1))
	if lnCurrentVersionNumber > lnNumberOfHighest
		lnIndexOfHighest = lnI
		lnNumberOfHighest = lnCurrentVersionNumber
	endif
next

* Run the program

lcFileName = laExeFileNames(lnIndexOfHighest, 1)
* ? lcFileName
run /n &lcFileName
wait window "Cargando programa principal, versión #" + transform(lnNumberOfHighest);
	timeout 10
* wait window "Loading main program, version #" + transform(lnNumberOfHighest);
	timeout 10
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform