Показать сообщение отдельно
Старый 15.01.2006, 20:28   #1
Cyxapeff
 
Сообщений: n/a
Попробовал тут эту прогу. Накатал быстренько приложение считающие корни квадратного уравнения. Запустил на эмуляторе - всё ок. Заливаю на свой Siemens CX65 - софт кнопок нет. Как бороться?

Вот исходный текст:
program FistMidlet; 

var a, b, c : string;
item1,item2, item3, a2, b2, c2, x1, x2, d : integer; 
cmdNext : command;
cmdQuit : command;
cmdStart, clicked : command; 


begin 
 // switch to form mode from default canvas mode 
 ShowForm; 
 
 while clicked <> cmdQuit do
 begin
 ClearForm;
 
  
 // add a text field to the form 
 item1 := FormAddTextField('A:', '', 20, TF_NUMERIC); 
 item2 := FormAddTextField('B:', '', 20, TF_NUMERIC); 
 item3 := FormAddTextField('C:', '', 20, TF_NUMERIC); 
  
 // create a command (button) 
 cmdNext := CreateCommand('Считать', CM_OK, 1); 
 AddCommand(cmdNext); 
  
 // wait until the user clickes on Go! command 
 repeat until GetClickedCommand = cmdNext; 
 RemoveCommand(cmdNext);
 
 
 // retrieve the entered name 
 a := FormGetText(item1); 
 b := FormGetText(item2); 
 c := FormGetText(item3); 
 
 a2 := StringToInteger(a);
 b2 := StringToInteger(B);
 c2 := StringToInteger©;
 
 d := (b2*b2)+(a2*c2*-4);
 
 ShowCanvas; 
 SetColor(255, 255, 255);
 FillRect(0, 0, GetWidth, GetHeight); 
 SetColor(0, 0, 0); 
 if d<0 then
 begin  
 DrawText('Дискриминант меньше нуля!', 0, 0); 
 end
 
 else begin
 
 if a2=0 then
 begin
  
 DrawText('На 0 делить нельзя!', 0, 0); 
 end
 else begin
 
 x1:=((-1)*b2-sqr(d)) div (2*a2);
 x2:=((-1)*b2+sqr(d)) div (2*a2);
  
 DrawText('x1: ' + x1, 0, 0);
 if x1<>x2 then
 DrawText('x2: ' + x2, 0, 20);

 end;
 end; 
 Repaint; 

 
 // create a quit command 
 cmdQuit := CreateCommand('Выход', CM_EXIT, 2); 
 AddCommand(cmdQuit); 
 cmdNext := CreateCommand('Считать', CM_OK, 1); 
 AddCommand(cmdNext);
 repeat
 clicked := GetClickedCommand; 
 until (clicked = cmdQuit) or (clicked = cmdNext); 
 RemoveCommand(cmdNext);
 RemoveCommand(cmdQuit);
 end; 
end.
 
Ответить с цитированием