Показать сообщение отдельно
Старый 18.02.2006, 21:46   #1
ZeFiR
 
Сообщений: n/a
Админы, классный форум. На оффсайте мидлет паскаля тупее...
к теме. xt в коде неправильно? прога ставит в степень число...
program Stepen; 

var a, b, c : string;
item1,item2, item3,label_id,l1,l2,lx1,lx2,dd: integer;
a2, b2, c2,d,x1, x2:real; 
cmdNext : command;
cmdQuit : command;
cmdStart, clicked,clicked1 : command; 
cmdOK:command;


begin 
 // switch to form mode from default canvas mode 
 ShowForm; 
  
 // add a text field to the form 
 item1 := FormAddTextField('A:', '', 20, TF_ANY); 
 item2 := FormAddTextField('B:', '', 20, TF_ANY);
  
 // create a command (button) 
 cmdNext := CreateCommand('OK!', CM_OK, 1); 
 AddCommand(cmdNext); 
  
 // wait until the user clickes on Go! command 
 repeat until GetClickedCommand = cmdNext; 
  
 // retrieve the entered name 
 a:= FormGetText(item1); 
 b:=FormGetText(item2);
 a2:=StringToReal(a,1);
 b2:=StringToReal(b,1);
 c2:=pow(a2,b2);
  
 // switch back to canvas mode and draw the text 
 ClearForm; 
 ShowForm;
  
 lx1:=FormAddString(IntegerToString(trunc(c2))); 
  
 // create a quit command 
 cmdQuit := CreateCommand('Quit', CM_EXIT, 1); 
 AddCommand(cmdQuit); 
 repeat until GetClickedCommand = cmdQuit;  
end.
 
Ответить с цитированием