如何將字串運算式讀進程式內進行運算 |
尚未結案
|
danielx2000
一般會員 ![]() ![]() 發表:29 回覆:33 積分:22 註冊:2002-09-02 發送簡訊給我 |
Dear all:
請教各位一個問題,
我想將一串運算式寫在ini檔內 並利用程式將這串運算式讀進進變數中進行運算 不知這有沒有方法可做到 Thanks example:
ini 檔內的運算式如下,且會隨意變化
[exp]
exp = (A > 10) and ( B=1) 有沒有簡單的方法可以做出decodeExp () 的函式 procedure DoExp()
var
a,b:integer;
x:string;
begin
x:= ini.readString('exp',exp,'');
A := 1; B:=2;
if decodeExp(x) then
begin
...
end;
end;
|
syntax
尊榮會員 ![]() ![]() ![]() ![]() ![]() ![]() 發表:26 回覆:1139 積分:1258 註冊:2002-04-23 發送簡訊給我 |
|
william
版主 ![]() ![]() ![]() ![]() ![]() 發表:66 回覆:2535 積分:3048 註冊:2002-07-11 發送簡訊給我 |
I think you want to take a look at the scripting... Search... and here is one (I never try): http://www.dwscript.com/ BTW, you can also try the WSH (Windows Scripting Host, which can be downloaded from M$ if not installed).
|
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |