FASTREPORT中不支援某些中文字該如何解決呢? |
答題得分者是:chinyu
|
jch
中階會員 ![]() ![]() ![]() 發表:111 回覆:224 積分:66 註冊:2003-12-01 發送簡訊給我 |
|
chinyu
高階會員 ![]() ![]() ![]() ![]() 發表:12 回覆:157 積分:153 註冊:2002-06-14 發送簡訊給我 |
引言: 不知各位前輩是否曾經使用FASTREPORT時遇到一些中文字無法使用(如"加") ,不知該如何解決呢?? ======================== 我是DELPHI5的初學者只要改下列程式碼就可以了(資料字典中可使用中文變數名稱)。 fr_class.pas procedure TfrView.ExpandVariables(var s: String); var i, j: Integer; s1, s2: String; begin i := 1; repeat //chinyu // while (i < Length(s)) and (s[i] <> '[') do Inc(i); while (i < Length(s)) and (s[i] <> '[') do begin Inc(i); if s[i-1] in LeadBytes then Inc(i); end; // end s1 := GetBrackedVariable(s, i, j); if i <> j then begin Delete(s, i, j - i 1); s2 := ''; CurReport.InternalOnGetValue(s1, s2); Insert(s2, s, i); Inc(i, Length(s2)); j := 0; end; until i = j; end; fr_pars.pas function GetBrackedVariable(const s: String; var i, j: Integer): String; var c: Integer; fl1, fl2: Boolean; begin j := i; fl1 := True; fl2 := True; c := 0; Result := ''; if (s = '') or (j > Length(s)) then Exit; Dec(j); repeat Inc(j); if fl1 and fl2 then // chinyu // if s[j] = '[' then if (s[j] = '[') and not (s[j-1] in LeadBytes) then // end begin if c = 0 then i := j; Inc(c); end // chinyu // else if s[j] = ']' then Dec(c); else if (s[j] = ']') and not (s[j-1] in LeadBytes) then Dec(c); // end if fl1 then if s[j] = '"' then fl2 := not fl2; if fl2 then if s[j] = '''' then fl1 := not fl1; until (c = 0) or (j >= Length(s)); Result := Copy(s, i 1, j - i - 1); end; |
jch
中階會員 ![]() ![]() ![]() 發表:111 回覆:224 積分:66 註冊:2003-12-01 發送簡訊給我 |
|
jch
中階會員 ![]() ![]() ![]() 發表:111 回覆:224 積分:66 註冊:2003-12-01 發送簡訊給我 |
|
chinyu
高階會員 ![]() ![]() ![]() ![]() 發表:12 回覆:157 積分:153 註冊:2002-06-14 發送簡訊給我 |
|
chinyu
高階會員 ![]() ![]() ![]() ![]() 發表:12 回覆:157 積分:153 註冊:2002-06-14 發送簡訊給我 |
引言: 程式已經改好了,但是"加"還是不能用???? ======================== 我是DELPHI5的初學者//解決在script edit 輸入下列程式碼時,在預覽報表時只會出現「0 」 //memo18.memo:='未兌現'; fr_intrp.pas procedure SkipSpace; begin while (buf^[cur] <= ' ') and (cur < len) do Inc(cur); end; function GetToken: String; var n, j: Integer; label 1; begin 1: SkipSpace; j := cur; while (buf^[cur] > ' ') and (cur < len) do begin if buf^[cur] in LeadBytes then cur:=cur 2; // vin-lee所加的命令 chinyu//解決Script在run time時中文的問題 FR_SynMemo.pas http://myweb.hinet.net/home6/chinyu/FR_SynMemo.pas |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |