Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Generate Version 1 UUIDs
Message
From
21/09/2017 06:30:38
 
 
To
21/09/2017 05:45:26
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
SAMBA Server
Database:
MySQL
Application:
Desktop
Miscellaneous
Thread ID:
01654423
Message ID:
01654480
Views:
75
>Ooww.. that is bad design. Relying on VFP specific principles and breaking several other rules that is only known to very few is very, very bad.
>Much better is to write a class that can be instantiated where the declaration of the API occurs only once in the declaration. Keep it simple.

Seen this quite often, with a function instead of a prg:
function apifunc(parms)
declare apifunc in ...
return apifunc(parms)
VFP searches in API functions before those in set('procedure')
example:
FUNCTION GetLastError
set step on 
DECLARE INTEGER GetLastError IN Win32API 
RETURN GetLastError()
ENDFUNC

? GetLastError() && set step on fires
? GetLastError() && set step DOES NOT fire
RETURN GetLastError() would recurse infinitely if the API function was not called first.

GDIplusX has a bunch of these, though using an alias, eg.:
*********************************************************************
FUNCTION xfcGdipGetMetafileHeaderFromStream(stream, header)
*********************************************************************
	DECLARE Long GdipGetMetafileHeaderFromStream IN GDIPLUS.DLL AS xfcGdipGetMetafileHeaderFromStream Integer stream, String @header
	RETURN xfcGdipGetMetafileHeaderFromStream(m.stream, @m.header)
ENDFUNC
Thierry Nivelet
FoxinCloud
Give your VFP application a second life, web-based, in YOUR cloud
http://foxincloud.com/
Never explain, never complain (Queen Elizabeth II)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform