Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / C++ [игнор отключен] [закрыт для гостей] / Переход с 5 на 6 Builder (проблема с хинтами) / 3 сообщений из 3, страница 1 из 1
24.04.2006, 10:52
    #33685570
ElenaVE
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Переход с 5 на 6 Builder (проблема с хинтами)
Если dfm открыть в 6 и сохранить, то потом проект make - ом не собирается. Если удалить все хинты, то все - ок. Помогите пожалуйста.
...
Рейтинг: 0 / 0
24.04.2006, 11:20
    #33685654
ElenaVE
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Переход с 5 на 6 Builder (проблема с хинтами)
Как сделать, чтобы при открытии и сохранении dfm, строки не сохранялись в UNICODE?
...
Рейтинг: 0 / 0
24.04.2006, 18:01
    #33687032
PPA
PPA
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Переход с 5 на 6 Builder (проблема с хинтами)
ElenaVEКак сделать, чтобы при открытии и сохранении dfm, строки не сохранялись в UNICODE?

Можно воспользоватся конвертором. который юникод обратно конвертит
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
(******************************************************************************)
(*  dfmcnv.dpr                                                                *)
(*    DFM conversion utility                                                  *)
(*    Author:   Nikolai Adrianov                                              *)
(*                                                                            *)
(*  v1. 00    04 / 05 / 2004                                                          *)
(*    Initial version                                                         *)
(*                                                                            *)
(******************************************************************************)
program dfmcnv;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  TConvertorState = (csNormal, csBehindSharp, csInsideQuotes);

procedure ConvertLine(var LineIn, LineOut: String);
var
  Ch: Char;
  Hex: String;
  State: TConvertorState;
  i: Integer;
begin
  State := csNormal;
  Hex := '';
  LineOut := '';
  i :=  1 ;
  while i <= Length(LineIn) +  1  do begin
    Ch := LineIn[i];
    case (State) of
    csNormal:
      if Ch = '#' then begin
        State := csBehindSharp;
        LineOut := LineOut + '''';
        Inc(i);
      end else if Ch = '''' then begin
        State := csInsideQuotes;
        LineOut := LineOut + Ch;
        Inc(i);
      end else begin
        LineOut := LineOut + Ch;
        Inc(i);
      end;
    csInsideQuotes:
      if Ch = '''' then begin
        if LineIn[i +  1 ] = '''' then begin
          LineOut := LineOut + Ch + Ch;
          Inc(i,  2 );
        end else if LineIn[i +  1 ] = '#' then begin
          State := csBehindSharp;
          Inc(i,  2 );
        end else begin
          State := csNormal;
          LineOut := LineOut + Ch;
          Inc(i);
        end;
      end else begin
        LineOut := LineOut + Ch;
        Inc(i);
      end;
    csBehindSharp:
      if Ch in ['0'..'9'] then begin
        Hex := Hex + Ch;
        Inc(i);
      end else begin
        LineOut := LineOut + String(WideChar(StrToInt(Hex)));
        Hex := '';
        if Ch = '''' then begin
          State := csInsideQuotes;
          Inc(i);
        end else if Ch = '#' then begin
          State := csBehindSharp;
          Inc(i);
        end else begin
          State := csNormal;
          LineOut := LineOut + '''' + Ch;
          Inc(i);
        end;
      end;
    end;
  end;
  SetLength(LineOut, Length(LineOut) -  1 );
end;

procedure ConvertFile(FileNameIn, FileNameOut: String);
var
  FileIn, FileOut: TextFile;
  LineIn, LineOut: String;
begin
  AssignFile(FileIn, FileNameIn);
  Reset(FileIn);
  try
    AssignFile(FileOut, FileNameOut);
    Rewrite(FileOut);
    try
      while not EOF(FileIn) do begin
        Readln(FileIn, LineIn);
        ConvertLine(LineIn, LineOut);
        Writeln(FileOut, LineOut);
      end;
    finally
      CloseFile(FileOut);
    end;
  finally
    CloseFile(FileIn);
  end;
end;

procedure ProcessFile(FileName: String);
begin
  Writeln('Processing file: ' + FileName);
  ConvertFile(FileName, FileName + '.d5');
  DeleteFile(FileName);
  RenameFile(FileName + '.d5', FileName);
end;

procedure ProcessDir(DirName: String);
var
  sr: TSearchRec;
begin
  Writeln('Processing directory: ' + DirName);
  if FindFirst(DirName + '\*.dfm', $7FFFFFFF, sr) =  0  then begin
    try
      repeat
        ProcessFile(DirName + '\' + sr.Name);
      until FindNext(sr) <>  0 ;
    finally
      FindClose(sr);
    end;
  end;
end;

procedure Usage;
begin
  Writeln('Usage: dfmcnv.exe [-f<filename>|-d<dirname>|-c|-?]');
  Writeln('  f - converts specified DFM file');
  Writeln('  d - converts all DFM''s in the directory');
  Writeln('  c - converts all DFM''s in the *current* directory');
  Writeln('  ? - displays this help.');
end;

var
  i: Integer;
  Flag: Char;
  Param, FileName, DirName: String;
begin
  Writeln('DFM conversion utility. (c) Nikolai Adrianov, 2004');
  try
    for i :=  1  to ParamCount do begin
      Param := ParamStr(i);
      if (Length(Param) <  2 ) or
        ((Param[ 1 ] <> '-') and (Param[ 1 ] <> '/')) then
      begin
        Writeln(Format('Incorrect parameter #%d: %s'# 13 # 10 , [i, Param]));
        Usage;
        ExitCode := - 1 ;
        Exit;
      end;
      Flag := Param[ 2 ];
      Delete(Param,  1 ,  2 );
      case Flag of
      'f':
        FileName := ExpandFileName(Param);
      'd':
        DirName := ExpandFileName(Param);
      'c':
        DirName := GetCurrentDir;
      '?', 'h':
        begin
          Usage;
          ExitCode :=  0 ;
          Exit;
        end;
      end;
    end;
    if FileName <> '' then begin
      ProcessFile(FileName);
    end else if DirName <> '' then begin
      ProcessDir(DirName);
    end else begin
      Writeln('No file or directory name specified.'# 13 # 10 );
      Usage;
      ExitCode := - 1 ;
      Exit;
    end;
  except on E: Exception do
    Writeln(E.Message);
  end;
end.

...
Рейтинг: 0 / 0
Форумы / C++ [игнор отключен] [закрыт для гостей] / Переход с 5 на 6 Builder (проблема с хинтами) / 3 сообщений из 3, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]