DEADSOFTWARE

c6c2f69dd056e7db6d8f3cdbcb8f94be8a5093d2
[cavecraft.git] / src / console.pas
1 unit console;
3 interface
4 const
5 version = 'BETA 9 DEV B12';
7 var
8 osadki:boolean;
9 bl_upd:integer;
10 s_get_drp:boolean;
11 drw_back:boolean;
12 drw_sm:boolean;
13 s_max_fps:integer;
14 s_jpeg_quality:integer;
15 drawgui:boolean;
16 light_type:integer;
18 ifosad:boolean;
20 load_sm:integer;
21 load_sky_siz:integer;
22 load_back_tex:boolean;
23 load_weather_tex:boolean;
24 load_light_tex:boolean;
25 load_gui_tex:boolean;
27 menu_background:integer;
29 load_minimap_tex:boolean;
31 //load_key_tex:integer;
33 drw_stars:boolean;
35 cheats:boolean;
37 sd:string;
39 EOFstr, ENDstr:boolean;
41 procedure save_settings;
42 procedure load_settings;
43 procedure call_console;
44 procedure exec(s, search:string);
45 procedure addToLog(str:string);
47 implementation
49 uses
50 keyboard,
51 vars,
52 maps,
53 items,
54 canvas,
55 mobs,
56 worldgen,
57 jsr75i,
58 particles,
59 func,
60 player,
61 sensor,
62 drop,
63 inv,
64 furnace,
65 items_store,
66 video;
68 const
69 CON_LOG_SIZE=9;
70 PARSER_MAX_STR=15;
71 MAX_IMGREG=2;
73 var
74 logSTR: array [0..CON_LOG_SIZE] of string;
75 lastCommand:string;
77 parseStr:string;
79 stack: array [0..0] of integer;
80 stack_pointer:integer;
82 regimg:image;
84 procedure resetStack(size:integer);
85 begin
86 stack_pointer:=0;
87 size:=size+1;
88 bytecode
89 iload 0;
90 newarray 10;
91 putstatic field 'console', 'stack', '[I';
92 end;
93 end;
95 procedure pushStack(i:integer;);
96 begin
97 stack[stack_pointer]:=i;
98 stack_pointer:=stack_pointer+1;
99 end;
101 function popStack:integer;
102 begin
103 stack_pointer:=stack_pointer-1;
104 popStack:=stack[stack_pointer];
105 end;
107 procedure swapStack;
108 var
109 tmp:integer;
110 begin
111 tmp:=stack[stack_pointer-2];
112 stack[stack_pointer-2]:=stack[stack_pointer-1];
113 stack[stack_pointer-1]:=tmp;
114 end;
116 procedure dupStack;
117 begin
118 stack[stack_pointer]:=stack[stack_pointer-1];
119 stack_pointer:=stack_pointer+1;
120 end;
122 procedure resetTmpImg;
123 var
124 nullimg:image;
125 begin
126 regimg:=nullimg;
127 end;
129 procedure addToLog(str:string);
130 var
131 i:integer;
132 begin
133 debug('::'+str);
134 for i:=CON_LOG_SIZE-1 downto 0 do
135 logSTR[i+1]:=logSTR[i];
136 logSTR[0]:=str;
137 end;
139 procedure setTexture(img:image; name:string; i:integer);
140 begin
141 name:=UpCase(name);
142 if name='BLOCK' then
143 begin
144 tex[i]:=img;
145 tex8[i]:=resize_image(img, 8, 8);
146 end;
147 else
148 if name='ITEM' then
149 begin
150 item[i]:=img;
151 item8[i]:=resize_image(img, 8, 8);
152 end;
153 else
154 if name='VKEY' then
155 setVkeyImg(img, i);
156 else
157 addToLog('Error: unknown texture type "'+name+'"');
158 end;
160 procedure save_settings;
161 var
162 rs:recordstore;
163 t:integer;
164 begin
165 deleteRecordStore('S');
166 rs:=openRecordStore('S');
167 t:=addRecordStoreEntry(rs,version);
168 t:=addRecordStoreEntry(rs,''+light_type);
169 t:=addRecordStoreEntry(rs,''+ifosad);
170 t:=addRecordStoreEntry(rs, '' + Particles.enabled);
171 t:=addRecordStoreEntry(rs,''+drawgui);
172 t:=addRecordStoreEntry(rs,''+s_jpeg_quality);
173 t:=addRecordStoreEntry(rs,''+load_key_tex);
174 closeRecordStore(rs);
175 end;
177 function sett_ld_bool(s:string):boolean;
178 begin
179 if s='true' then sett_ld_bool:=true;
180 end;
182 procedure load_settings;
183 var
184 rs:recordstore;
185 begin
186 rs:=openRecordStore('S');
187 if readRecordStoreEntry(rs,1)<>version then
188 begin
189 debug(readRecordStoreEntry(rs,1));
190 closeRecordStore(rs);
191 exit;
192 end;
193 light_type:=stringtointeger(readRecordStoreEntry(rs,2));
194 ifosad:=sett_ld_bool(readRecordStoreEntry(rs,3));
195 Particles.enabled := sett_ld_bool(readRecordStoreEntry(rs, 4));
196 drawgui:=sett_ld_bool(readRecordStoreEntry(rs,5));
197 s_jpeg_quality:=stringtointeger(readRecordStoreEntry(rs,6));
198 load_key_tex:=stringtointeger(readRecordStoreEntry(rs,7));
199 closeRecordStore(rs);
200 end;
202 function isEOS(c:integer):boolean;
203 var
204 ch:char;
205 begin
206 ch:=chr(c);
207 if (ch=#$0A) or (ch=#$0D) then
208 isEOS:=true;
209 end;
211 function isSpace(c:integer;):boolean;
212 var
213 ch:char;
214 begin
215 ch:=chr(c);
216 if ((ch=' ') or (ch=#$09) or (ch=#$0B) or isEOS(c)) then
217 isSpace:=true;
218 end;
220 function nextByte(res:resource):integer;
221 var
222 i:integer;
223 begin
224 i:=ReadByte(res);
225 if i=EOF then
226 EOFstr:=true;
227 if isEOS(i) then
228 ENDstr:=true;
230 nextByte:=i and $FF;
231 end;
233 function ReadString(res:resource):string;
234 var
235 b:integer;
236 tmpstr:string;
237 begin
238 ENDstr:=false;
239 repeat
240 b:=nextByte(res);
241 if EOFstr or ENDstr then
242 break;
244 tmpstr:=tmpstr+chr(b);
245 forever;
246 ReadString:=tmpstr;
247 end;
249 function nextChar:integer;
250 var
251 i:integer;
252 begin
253 ENDstr:=false;
254 if length(parseStr)>0 then
255 begin
256 i:=ord(getChar(parseStr, 0));
257 parseStr:=copy(parseStr, 1, length(parseStr));
258 if isEOS(i) then
259 ENDstr:=true;
260 end;
261 else
262 begin
263 parseStr:='';
264 ENDstr:=true;
265 end;
267 nextChar:=i;
268 end;
270 procedure clearSpaces;
271 var
272 i:integer;
273 begin
274 repeat
275 i:=nextChar;
276 if ENDstr then
277 exit;
279 {Symbol ';' is one line commentary}
280 if i=$3B then
281 begin
282 repeat
283 i:=nextChar;
284 if ENDstr then
285 exit;
286 forever;
287 end;
289 if isSpace(i)=false then
290 begin
291 //Go back
292 parseStr:=chr(i)+parseStr;
293 exit;
294 end;
295 forever;
296 end;
298 function nextWord:string;
299 var
300 str:string;
301 i:integer;
302 begin
303 ENDstr:=false;
304 clearSpaces;
305 repeat
306 i:=nextChar;
308 if ENDstr then
309 begin
310 nextWord:=str;
311 exit;
312 end;
314 if isSpace(i) then
315 begin
316 //Go back
317 parseStr:=chr(i)+parseStr;
318 nextWord:=str;
319 exit;
320 end;
321 else
322 str:=str+chr(i);
323 forever;
324 end;
326 function strToBool(str:string):boolean;
327 begin
328 str:=UpCase(str);
329 if str='TRUE' then
330 strToBool:=true;
331 else
332 if str='FALSE' then
333 strToBool:=true;
334 else
335 if StringToInteger(str)<>0 then
336 strToBool:=true;
337 else
338 strToBool:=false;
339 end;
341 //Перевод строки в целое число. base - система счисления
342 function Str2Dec(str:string; base:integer;):integer;
343 var
344 i, tmp, res:integer;
345 ch:char;
346 neg:boolean;
347 begin
348 str:=UpCase(str);
349 if GetChar(str, 0)='-' then
350 begin
351 neg:=true;
352 i:=i+1;
353 end;
355 for i:=i to length(str)-1 do
356 begin
357 ch:=GetChar(str, i);
358 if ((ch>='0') and (ch<='9')) then
359 tmp:=ord(ch)-$30;
360 else
361 if ((ch>='A') and (ch<=chr($36+base))) then
362 tmp:=ord(ch)-$37;
363 else
364 begin
365 addToLog('Error! I cant decode "'+str+'" -> "'+ch+'"');
366 Str2Dec:=0;
367 exit;
368 end;
370 res:=res*base+tmp;
371 end;
373 if neg then
374 Str2Dec:=-res;
375 else
376 Str2Dec:=res;
377 end;
379 function getVar(name:string):integer;
380 begin
381 name:=UpCase(name);
383 if name='SCREEN_W' then
384 getVar:=getWidth;
385 else
386 if name='SCREEN_H' then
387 getVar:=getHeight;
388 else
389 addToLog('Unknown variable "'+name+'"');
390 end;
392 procedure setVar(name:string; value:integer);
393 begin
394 name:=UpCase(name);
396 addToLog('I cant set variable "'+name+'"');
397 end;
399 function DecodeInt(str:string):integer;
400 var
401 head:char;
402 num:string;
403 begin
404 if str='' then
405 begin
406 addToLog('DecodeInt getted null string!');
407 DecodeInt:=0;
408 exit;
409 end;
411 str:=UpCase(str);
412 head:=getchar(str, 0);
413 num:=copy(str, 1, length(str));
415 if str='TRUE' then
416 DecodeInt:=1;
417 else
418 if str='FALSE' then
419 DecodeInt:=0;
420 else
421 if str='POP' then
422 DecodeInt:=popStack;
423 else
424 if head='$' then
425 DecodeInt:=getVar(num);
426 else
427 if (head='0') and (getchar(str, 1)='X') then
428 begin
429 DecodeInt:=Str2Dec(copy(str, 2, length(str)), 16);
430 end;
431 else
432 if (head='0') and (length(str)>1) then
433 begin
434 DecodeInt:=Str2Dec(num, 8);
435 end;
436 else
437 if head='B' then
438 begin
439 DecodeInt:=Str2Dec(num, 2);
440 end;
441 else
442 if ((head>='0') and (head<='9')) or (head='-') then
443 begin
444 DecodeInt:=Str2Dec(str, 10);
446 end;
447 else
448 addToLog('Error! I cant decode "'+str+'"');
449 end;
451 procedure exeCommand(str:string);
452 var
453 com, tmp, tmp2:string;
454 i:integer;
455 begin
456 parseStr:=str;
457 clearSpaces;
458 if parseStr='' then
459 exit;
461 com:=UpCase(nextWord);
463 if (cheats) or (gamemode=1) then
464 begin
465 if com='TIME' then
466 game_time:=decodeInt(nextWord);
467 else
468 if com='FLY' then
469 fly:=strToBool(nextWord);
470 else
471 if com='PL_HP' then
472 hp:=decodeInt(nextWord);
473 else
474 if com='PL_EP' then
475 hunger:=decodeInt(nextWord);
476 else
477 if com='GIVE' then
478 player.dropItem(decodeInt(nextWord), decodeInt(nextWord));
479 else
480 if com='PL_TP' then
481 begin
482 player.setX(decodeInt(nextWord));
483 player.setY(decodeInt(nextWord));
484 end;
485 else
486 if com='GAMEMODE' then
487 begin
488 gamemode:=decodeInt(nextWord);
489 fly:=false;
490 end;
491 else
492 if com='SPAWN' then
493 begin
494 player.setX(get_spawn_x*16+4);
495 player.setY(get_spawn_y*16);
496 end;
497 else
498 {if com='SPAWN_MOBS' then
499 s_spawn_mob:=strToBool(nextWord);
500 else}
501 {if com='SURVIVAL' then
502 begin
503 fly:=false;
504 gamemode:=0;
505 hp:=20;
506 hunger:=20;
507 for i:=0 to 35 do
508 begin
509 inv[i].item_i:=0;
510 inv[i].sum_i:=0;
511 end;
512 end;
513 else}
514 if com='CLEAR_INVENTORY' then
515 begin
516 inv.resetData;
517 end;
518 else
520 end;
522 if com='I_AM_CHEATER' then
523 begin
524 if nextWord=#$36+#$36+#$36 then
525 cheats:=not cheats;
526 else
527 cheats:=false;
528 end;
529 else
530 if com='HALT' then
531 halt;
532 else
533 if com='WEATHER' then
534 osadki:=strToBool(nextWord);
535 else
536 {if com='MEGASPAWN' then
537 megaspawn;
538 else}
539 if com='REF_DRP' then
540 ref_drp:=strToBool(nextWord);
541 else
542 if com='BL_UPD' then
543 bl_upd:=decodeInt(nextWord);
544 else
545 if com='GET_DRP' then
546 s_get_drp:=strToBool(nextWord);
547 else
548 if com='MAX_FPS' then
549 s_max_fps:=decodeInt(nextWord); else
550 if com='DRW_BACK' then
551 drw_back:=strToBool(nextWord);
552 else
553 {if com='DRW_MOBS' then
554 drw_mobs:=strToBool(nextWord);
555 else}
556 if com='DRP_PHY' then
557 drp_phy:=strToBool(nextWord);
558 else
559 if com='DRW_SM' then
560 drw_sm:=strToBool(nextWord);
561 else
562 if com='JPEG_Q' then
563 begin
564 s_jpeg_quality:=decodeInt(nextWord);
565 if s_jpeg_quality>100 then
566 s_jpeg_quality:=100;
567 else if s_jpeg_quality<0 then
568 s_jpeg_quality:=0;
569 end;
570 else
571 if com='LOAD_SM' then
572 load_sm:=decodeInt(nextWord);
573 else
574 if com='S_WEATHER' then
575 ifosad:=strToBool(nextWord);
576 else
577 if com='S_HIDE_GUI' then
578 drawgui:=strToBool(nextWord);
579 else
580 if com='S_LIGHT' then
581 light_type:=decodeInt(nextWord);
582 else
583 if com='S_PARTICLES' then
584 Particles.enabled := strToBool(nextWord);
585 else
586 if com='LOAD_SKY' then
587 load_sky_siz:=decodeInt(nextWord);
588 else
589 {if com='LOAD_MOB_TEX' then
590 load_mob_tex:=strToBool(nextWord);
591 else}
592 if com='LOAD_BACK_TEX' then
593 load_back_tex:=strToBool(nextWord);
594 else
595 if com='LOAD_WEATHER_TEX' then
596 load_weather_tex:=strToBool(nextWord);
597 else
598 if com='LOAD_LIGHT_TEX' then
599 load_light_tex:=strToBool(nextWord);
600 else
601 if com='LOAD_GUI_TEX' then
602 load_gui_tex:=strToBool(nextWord);
603 else
604 if com='MENU_BACKGROUND' then
605 menu_background:=decodeInt(nextWord);
606 else
607 if com='DRW_DRP' then
608 drw_drp:=strToBool(nextWord);
609 else
610 if com='DRW_STARS' then
611 drw_stars:=strToBool(nextWord);
612 else
613 if com='SV_SETT' then
614 save_settings;
615 else
616 if com='LD_SETT' then
617 load_settings;
618 else
619 if com='LOAD_MINIMAP_TEX' then
620 load_minimap_tex:=strToBool(nextWord);
621 else
622 if com='EXEC' then
623 begin
624 tmp:=nextWord;
625 exec(nextWord, tmp);
626 end;
627 else
628 if com='RESET_ITEMS' then
629 begin
630 resetItems(decodeInt(nextWord)+1);
631 //addToLog('Max items: '+decodeInt(parsed_str[1]));
632 end;
633 else
634 if com='SET_ITEM' then
635 begin
636 setItemData(decodeInt(nextWord),
637 decodeInt(nextWord),
638 decodeInt(nextWord),
639 decodeInt(nextWord),
640 decodeInt(nextWord),
641 decodeInt(nextWord));
642 end;
643 else
644 if com='RESET_BLOCKS' then
645 begin
646 resetBlocks(decodeInt(nextWord)+1);
647 //addToLog('Max blocks: '+decodeInt(parsed_str[1]));
648 end;
649 else
650 if com='SET_BLOCK' then
651 begin
652 setBlockData(decodeInt(nextWord),
653 decodeInt(nextWord),
654 decodeInt(nextWord),
655 decodeInt(nextWord),
656 decodeInt(nextWord),
657 decodeInt(nextWord),
658 decodeInt(nextWord),
659 decodeInt(nextWord),
660 decodeInt(nextWord));
661 end;
662 else
663 if com='RESET_TOOLS' then
664 begin
665 resetTools(decodeInt(nextWord)+1);
666 //addToLog('Max tools: '+decodeInt(parsed_str[1]));
667 end;
668 else
669 if com='SET_TOOL' then
670 begin
671 setToolData(decodeInt(nextWord),
672 decodeInt(nextWord),
673 decodeInt(nextWord),
674 decodeInt(nextWord),
675 decodeInt(nextWord));
676 end;
677 else
678 if com='RESET_FUELS' then
679 begin
680 furnace.setMaxFuel(decodeInt(nextWord));
681 //addToLog('Max fuel: '+decodeInt(parsed_str[1]));
682 end;
683 else
684 if com='SET_FUEL' then
685 begin
686 furnace.initFuel(decodeInt(nextWord),
687 decodeInt(nextWord),
688 decodeInt(nextWord));
689 end;
690 else
691 if com='RESET_RECIPES' then
692 begin
693 furnace.setMaxRecipes(decodeInt(nextWord));
694 //addToLog('Max recipes: '+decodeInt(parsed_str[1]));
695 end;
696 else
697 if com='SET_RECIPE' then
698 begin
699 furnace.initRecipe(decodeInt(nextWord),
700 decodeInt(nextWord),
701 decodeInt(nextWord));
702 end;
703 else
704 if com='RESET_CRAFTS' then
705 begin
706 resetCrafts(decodeInt(nextWord));
707 //addToLog('Max crafts: '+decodeInt(parsed_str[1]));
708 end;
709 else
710 if com='SET_CRAFT_IN' then
711 begin
712 setCraftIn(decodeInt(nextWord),
713 decodeInt(nextWord),
714 decodeInt(nextWord),
715 decodeInt(nextWord));
716 end;
717 else
718 if com='SET_CRAFT_OUT' then
719 begin
720 setCraftOUT(decodeInt(nextWord),
721 decodeInt(nextWord),
722 decodeInt(nextWord),
723 decodeInt(nextWord));
724 end;
725 else
726 if com='RESET_BLOCKS_TEX' then
727 begin
728 initBlockTex(decodeInt(nextWord));
729 end;
730 else
731 if com='RESET_ITEMS_TEX' then
732 begin
733 initItemTex(decodeInt(nextWord));
734 end;
735 else
736 if com='LOAD_TEX' then
737 begin
738 regimg:=ld_tex(nextWord, '/'+sd+'/cavecraft/texturepacks/'+tex_pack+'/', '');
739 end;
740 else
741 if com='RESET_TEX' then
742 resetTmpImg;
743 else
744 if com='SET_TEX' then
745 setTexture(regimg,
746 nextWord,
747 decodeInt(nextWord));
748 if com='SET_CANV_TEX' then
749 begin
750 tmp:=nextWord;
751 tmp2:=nextWord;
752 setTexture(rotate_image_from_image(regimg,
753 decodeInt(nextWord),
754 decodeInt(nextWord),
755 decodeInt(nextWord),
756 decodeInt(nextWord),
757 0),
758 tmp,
759 decodeInt(tmp2));
760 end;
761 else
762 if com='SET_MAX_ITEM_LIST' then
763 setMaxItemList(decodeInt(nextWord));
764 else
765 if com='SET_ITEM_LIST' then
766 setItemList(decodeInt(nextWord),
767 decodeInt(nextWord));
768 else
769 if com='BIND_KEY' then
770 begin
771 tmp:=nextWord;
772 for i:=0 to MAX_KEY_BIND do
773 keyboard.bindKey(decodeInt(tmp), i, decodeInt(nextWord));
774 end;
775 else
776 if com='STACK' then
777 resetStack(decodeInt(nextWord));
778 else
779 if com='PUSH' then
780 pushStack(decodeInt(nextWord));
781 else
782 if com='POP' then
783 i:=popStack;
784 else
785 if com='SWAP' then
786 swapStack;
787 else
788 if com='DUP' then
789 dupStack;
790 else
791 if com='ADD' then
792 pushStack(popStack+popStack);
793 else
794 if com='SUB' then
795 begin
796 i:=popStack;
797 pushStack(popStack-i);
798 end;
799 else
800 if com='MUL' then
801 pushStack(popStack*popStack);
802 else
803 if com='DIV' then
804 begin
805 i:=popStack;
806 pushStack(popStack/i);
807 end;
808 else
809 if com='MOD' then
810 begin
811 i:=popStack;
812 pushStack(popStack mod i);
813 end;
814 else
815 if com='SET' then
816 setVar(nextWord, decodeInt(nextWord));
817 else
818 if com='POPSET' then
819 setVar(nextWord, popStack);
820 else
821 if com='MAX_VKEYS' then
822 resetVirtualKeyboard(decodeInt(nextWord));
823 else
824 if com='SET_VKEY' then
825 bindVKey(decodeInt(nextWord),
826 decodeInt(nextWord),
827 decodeInt(nextWord),
828 decodeInt(nextWord));
829 else
830 if com='SET_RESOLUTION' then
831 initVideo(decodeInt(nextWord), decodeInt(nextWord), strToBool(nextWord));
832 else
833 //addToLog('Unknown command "'+com+'"');
834 end;
836 procedure call_console;
837 var
838 commandTxt:integer;
839 i, tmpid:integer;
840 exitCmd, exeCmd, Clicked:command;
841 str:string;
842 begin
844 setFont(FONT_FACE_SYSTEM,FONT_STYLE_PLAIN,FONT_SIZE_SMALL);
846 repeat
847 ClearForm;
849 exitCmd:=createCommand('Exit', CM_EXIT, 1);
850 exeCmd:=createCommand('Execute', CM_OK, 1);
851 addCommand(exitCmd);
852 addCommand(exeCmd);
854 commandTxt:=formAddTextField('Enter command:', ''+lastCommand, 32, TF_ANY);
856 for i:=0 to CON_LOG_SIZE do
857 tmpid:=formAddString(logSTR[i]+chr(10));
859 ShowForm;
860 Repaint;
862 repeat
863 Clicked:=getClickedCommand;
864 if Clicked=exitCmd then
865 begin
866 lastCommand:=formGetText(commandTxt);
867 showCanvas;
868 exit;
869 end;
870 else
871 if Clicked=exeCmd then
872 begin
873 str:=formGetText(commandTxt);
874 addToLog(str);
875 exeCommand(str);
876 lastCommand:='';
877 break;
878 end;
879 forever;
880 forever;
881 end;
883 procedure exec(s, search:string);
884 var
885 res:resource;
886 str:string;
887 tmpEOF : Boolean;
888 begin
889 search:=UpCase(search);
891 if search='LOCAL' then
892 begin
893 addToLog('Load file "'+s+'" at LOCAL!');
894 res:=OpenResource('/'+s);
895 end;
896 else
897 if search='SD' then
898 begin
899 if open_file('/'+sd+'/cavecraft/'+s)=1 then
900 begin
901 addToLog('Load file "'+s+'" at SD!');
902 res:=get_stream;
903 end;
904 end;
905 else
906 if search='AUTO' then
907 begin
908 addToLog('path "/'+sd+'/cavecraft/'+s+'"');
909 if file_exists('/'+sd+'/cavecraft/'+s)=1 then
910 begin
911 if open_file('/'+sd+'/cavecraft/'+s)=1 then
912 begin
913 addToLog('Load file "'+s+'" at SD(AUTO)!');
914 res:=get_stream;
915 end;
916 end;
917 else
918 begin
919 addToLog('Load file "'+s+'" at LOCAL(AUTO)!');
920 res:=OpenResource('/'+s);
921 end;
922 end;
923 else
924 begin
925 addToLog('Unknown load type "'+search+'", file "'+s+'" not executed!');
926 exit;
927 end;
929 if ResourceAvailable(res) then
930 repeat
931 str:=ReadString(res);
932 tmpEOF:=EOFstr;
933 //addToLog('Exec: "'+str+'"');
934 exeCommand(str);
935 EOFstr:=tmpEOF;
936 until EOFstr;
937 else
938 addToLog('Execute file "'+s+'" not found!');
940 EOFstr := false;
941 ENDstr := false;
942 CloseResource(res);
943 end;
945 initialization
947 end.