Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Prevent VFP Function from being used
Message
From
03/01/2006 11:34:36
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
03/01/2006 11:21:01
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01082633
Message ID:
01082664
Views:
9
This message has been marked as a message which has helped to the initial question of the thread.
>>Where exactly do you need to prevent VFP functions from being used? Normally, in your programs, you, the programmer, choose what functions to use. The end-user doesn't get much options in this respect.
>
>Yes they do. There are several areas of my application where I let users write code. I keep that code in Memo fields and it is Compiled and Run on-the-fly.
>
>That way, users (Power Users, System Administrators, in general) can Customize diferent parts of the application.
>
>But there are parts of my application where I want to prevent them from executing some of the VFP Functions.

Perhaps a series of #define statements, as mentioned by Fabio, would help in this case.

Another alternative might be to check for certain functions before you compile. Just use the $ operator. I suggest you use a table with forbidden functions. Note that user-defined functions might also be excluded, since the user might otherwise have access to features in your program which you would rather want to restrict (or control, through some condition).
if "sqrt" $ MemoCode
  MessageBox("You are using a forbidden function.")
else
  * compile and execute here
endif
You can also replace the code before compiling.
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