#50799 - 2000-08-16 12:04 AM
Re: KIXTART-TOOL: stripping kix code/reformatting kix code
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
code:
?"- 490-" ?"- 491-" SHELL "%comspec% /c $method " +'"'+ $target + '" \\$ip > @curdir\cache.log' ?"- 492-" ?"- 493-" ; lets wait a litle until the log file created ... ?"- 494-" WHILE open(1, @curdir + "\cache.log" ,2) <> 0 ?"- 495-" SLEEP 1 ?"- 496-" LOOP ?"- 497-" ?"- 498-" IF ?"- 499-" getfilesize(@curdir + "\cache.log")=0 ?"- 500-" $null="There are not any " + $method + " " + $target ?"- 501-" COLOR r+/n chr(9)+$null COLOR w/n ? ? ?"- 502-" $null=writeline(2,chr(9)+$null+chr(13)+chr(10)) ?"- 503-" GOTO "nonethere" ?"- 504-" ENDIF ?"- 505-" ?"- 506-" $null=readline(1) COLOR g+/n chr(9)+$null ? ?"- 507-" DO ?"- 508-" $null=writeline(2,chr(9)+$null+chr(13)+chr(10)) ?"- 509-" $null=readline(1) ?"- 510-" chr(9)+$null ? ?"- 511-" UNTIL @error=-1 ?"- 512-" :nonethere ?"- 513-" $null=close(1) ?"- 514-" $null=writeline(2,chr(13)+chr(10)) ?"- 515-" $n=$n+1 ?"- 516-" UNTIL $n=5 ?"- 517-" $null=close(1) ?"- 518-" ?"- 519-" COLOR w/n ?"- 520-" "Discovering remote share resources, at host " COLOR c+/n $ip COLOR w/n " Please wait ..." ? ?"- 521-" "----------------------------------------------------------------------------" ? ?"- 522-" $null=writeline(2, ; -------> Warning KIXSTRIP: 522 line incomplete "left parenthesis". ; -------> Warning KIXSTRIP: 522 line incompleted. ?"- 523-" "Remote Shares at host " + $ip + " are"+chr(13)+chr(10)) ; -------> Warning KIXSTRIP: 523 line incomplete "right parenthesis". ; -------> Warning KIXSTRIP: 523 line incompleted. ?"- 524-" $null=writeline(2,"-----------------------------------------------------"+chr(13)+chr(10)) ?"- 525-" ?"- 526-" ?"- 527-" SHELL "%comspec% /c net view \\$ip > @curdir\cache.log" ?"- 528-" ?"- 529-" ; lets wait a litle until the log file created ... ?"- 530-" WHILE open(1, @curdir + "\cache.log" ,2) <> 0 ?"- 531-" SLEEP 1 ?"- 532-" LOOP ?"- 533-" ?"- 534-" IF getfilesize(@curdir + "\cache.log")=0 ?"- 535-" $null="Could not get shares" ?"- 536-" COLOR r+/n chr(9)+$null COLOR w/n ? ? ?"- 537-" $null=writeline(2,chr(9)+$null+chr(13)+chr(10)) ?"- 538-" $null=close(1) ?"- 539-" GOTO "nextip" ?"- 540-" ENDIF ?"- 541-" ?"- 542-" IF substr(readline(1),1,5)="There" COLOR r+/n ?"- 543-" chr(9)+"There is not any share resource" ? ? ?"- 544-" $null=writeline(2,chr(9)+ ; -------> Warning KIXSTRIP: 544 line incomplete "left parenthesis". ; -------> Warning KIXSTRIP: 544 line incompleted. ?"- 545-" "There is not any share resource"+chr(13)+chr(10)+chr(13)+chr(10)) ; -------> Warning KIXSTRIP: 545 line incomplete "right parenthesis". ; -------> Warning KIXSTRIP: 545 line incompleted. ?"- 546-" $null=close(1) ?"- 547-" GOTO "nextip" ?"- 548-" ENDIF ?"- 549-" ?"- 550-" ; here is some text formatting commands ?"- 551-" DO $null=readline(1) ?"- 552-" UNTIL substr($null,1,2)="--" OR @error=-1 ?"- 553-" $null=readline(1) ?"- 554-" ?"- 555-" COLOR g+/n ?"- 556-" DO ?"- 557-" $null ? ?"- 558-" $null=writeline(2,chr(9)+$null+chr(13)+chr(10)) ?"- 559-" $null=readline(1) ?"- 560-" UNTIL substr($null,1,7)="The com" OR @error=-1 ?"- 561-" $null=writeline(2,chr(13)+chr(10)) ?"- 562-" $null=close(1) ? ?"- 563-" ?"- 564-" :nextip ?"- 565-" ?"- 566-" ; **************************************************************** ?"- 567-" ; *************** Here stops the code of inner loop ************** ?"- 568-" ; **************************************************************** ?"- 569-" ?"- 570-" $d1=$d1+1 ?"- 571-" LOOP ?"- 572-" $c1=$c1+1 ?"- 573-" LOOP ?"- 574-" $b1=$b1+1 ?"- 575-" LOOP ?"- 576-" $a1=$a1+1 ?"- 577-" LOOP ?"- 578-" ; ---- aggressive loop is stoped ?"- 579-" ?"- 580-" ?"- 581-" ?"- 582-" :endloop ?"- 583-" $null=close(2) ?"- 584-" IF exist (@curdir + "\cache.log") DEL @curdir + "\cache.log" ENDIF ?"- 585-" ?"- 586-" ?"- 587-" ?"- 588-" ; ****************************************************************** ?"- 589-" ; * * ?"- 590-" ; * Here is the Repository place for Custom Subroutines * ?"- 591-" ; * * ?"- 592-" ; ****************************************************************** ?"- 593-" ?"- 594-" ?"- 595-" GOTO "end" ?"- 596-" ?"- 597-" ; Here is my split Subroutine which brings the power ?"- 598-" ; of Perl to Kixtart Enviroment. With Split ?"- 599-" ; SubRoutine, You can split every string which is ?"- 600-" ; seperated internal with the specified delimiter, to ?"- 601-" ; sequential array entries. The array is created ?"- 602-" ; automaticaly with the appropriate length. Unfortune- ?"- 603-" ; ly in kix if you want to use an array you have to ?"- 604-" ; declare it at the start. Thats why exist the ?"- 605-" ; translation table at the end of the code. ?"- 606-" ; Now it is a piece of cace to edit and procced Ip ?"- 607-" ; addresses and CSV files. ?"- 608-" ; ?"- 609-" ; Before call this SubRoutine you must have specify ?"- 610-" ; the $string and the $delimeter variables ?"- 611-" ; ?"- 612-" ; George Bouras ?"- 613-" ; netcom@matrix.kapatel.gr ?"- 614-" ; ?"- 615-" ?"- 616-" :split ?"- 617-" $n=0 ?"- 618-" $n_subrout=1 $k_subrout=0 DO ?"- 619-" $dot=substr($string,$n_subrout,1) ?"- 620-" IF $dot=$delimeter $k_subrout=$k_subrout+1 ENDIF ?"- 621-" $n_subrout=$n_subrout+1 ?"- 622-" UNTIL $n_subrout=len($string) ?"- 623-" DIM $sector[$k_subrout+2] ?"- 624-" ?"- 625-" DO ?"- 626-" $sector[$k_subrout]="" ?"- 627-" $k_subrout=$k_subrout-1 ?"- 628-" UNTIL $k_subrout=0 $sector[0]="" ?"- 629-" ?"- 630-" $n_subrout=1 DO ?"- 631-" $dot=substr($string,$n_subrout,1) ?"- 632-" IF $dot=$delimeter $k_subrout=$k_subrout+1 GOTO "skip" ENDIF ?"- 633-" $sector[$k_subrout]=$sector[$k_subrout]+$dot ?"- 634-" :skip ?"- 635-" $n_subrout=$n_subrout+1 ?"- 636-" UNTIL $n_subrout=len($string)+1 ?"- 637-" ?"- 638-" $n_subrout=$k_subrout ?"- 639-" DO ?"- 640-" $sector[$n_subrout+1]=ltrim(rtrim($sector[$n_subrout])) ?"- 641-" $n_subrout=$n_subrout-1 ?"- 642-" UNTIL $n_subrout=-1 ?"- 643-" $nomore_sub=$k_subrout + 1 ?"- 644-" ?"- 645-" IF $nomore_sub => 1 $sector1 = $sector[1] ELSE GOTO "endsplit" ENDIF ?"- 646-" IF $nomore_sub => 2 $sector2 = $sector[2] ELSE GOTO "endsplit" ENDIF ?"- 647-" IF $nomore_sub => 3 $sector3 = $sector[3] ELSE GOTO "endsplit" ENDIF ?"- 648-" IF $nomore_sub => 4 $sector4 = $sector[4] ELSE GOTO "endsplit" ENDIF ?"- 649-" IF $nomore_sub => 5 $sector5 = $sector[5] ELSE GOTO "endsplit" ENDIF ?"- 650-" IF $nomore_sub => 6 $sector6 = $sector[6] ELSE GOTO "endsplit" ENDIF ?"- 651-" IF $nomore_sub => 7 $sector7 = $sector[7] ELSE GOTO "endsplit" ENDIF ?"- 652-" IF $nomore_sub => 8 $sector8 = $sector[8] ELSE GOTO "endsplit" ENDIF ?"- 653-" IF $nomore_sub => 9 $sector9 = $sector[9] ELSE GOTO "endsplit" ENDIF ?"- 654-" IF $nomore_sub => 10 $sector10 = $sector[10] ELSE GOTO "endsplit" ENDIF ?"- 655-" IF $nomore_sub => 11 $sector11 = $sector[11] ELSE GOTO "endsplit" ENDIF ?"- 656-" IF $nomore_sub => 12 $sector12 = $sector[12] ELSE GOTO "endsplit" ENDIF ?"- 657-" IF $nomore_sub => 13 $sector13 = $sector[13] ELSE GOTO "endsplit" ENDIF ?"- 658-" IF $nomore_sub => 14 $sector14 = $sector[14] ELSE GOTO "endsplit" ENDIF ?"- 659-" IF $nomore_sub => 15 $sector15 = $sector[15] ELSE GOTO "endsplit" ENDIF ?"- 660-" IF $nomore_sub => 16 $sector16 = $sector[16] ELSE GOTO "endsplit" ENDIF ?"- 661-" IF $nomore_sub => 17 $sector17 = $sector[17] ELSE GOTO "endsplit" ENDIF ?"- 662-" IF $nomore_sub => 18 $sector18 = $sector[18] ELSE GOTO "endsplit" ENDIF ?"- 663-" IF $nomore_sub => 19 $sector19 = $sector[19] ELSE GOTO "endsplit" ENDIF ?"- 664-" IF $nomore_sub => 20 $sector20 = $sector[20] ELSE GOTO "endsplit" ENDIF ?"- 665-" :endsplit ?"- 666-" RETURN ?"- 667-" ?"- 668-" ; Here is some information about the right syntax of IP range ?"- 669-" ?"- 670-" :badip ?"- 671-" CLS COLOR g+/n ? ?"- 672-" " The IP range you enter has invalid format" ? ?"- 673-" " The general syntax of IP range is the following : " ? ? ?"- 674-" COLOR y+/n ?"- 675-" " a.b.c.d" COLOR g+/n " where every letter can be" ? ? ?"- 676-" COLOR y+/n " a number " COLOR g+/n " between 1 and 254" COLOR y+/n ? ?"- 677-" " *" COLOR g+/n " for the whole range from 1 to 254" ? COLOR y+/n ?"- 678-" " [m-n]" COLOR g+/n " for the range from m to n" ? ? ?"- 679-" " Some valid suntaxes are : " ? ? COLOR c+/n ?"- 680-" " 192.168.0.2" ? ? ?"- 681-" " 10.*.1.[12-14]" ? ? ?"- 682-" " [10-11].*.123.[200-212]" ? ? ?"- 683-" " *.*.[1-4].[100-110]" ? ? COLOR g+/n ?"- 684-" " Press any key to continue ... " GET $null COLOR w/n CLS ?"- 685-" RETURN ?"- 686-" ?"- 687-" ?"- 688-" ; ----- A subroutine to draw a -------------------------------- ?"- 689-" ; ----- message box to the center ----------------------------- ?"- 690-" ; ----- of the scren ------------------------------------------ ?"- 691-" ?"- 692-" ?"- 693-" :dosbox ?"- 694-" CLS ?"- 695-" :dosboxnocls ?"- 696-" $n=1 ?"- 697-" DO ?"- 698-" $n=$n+1 ?"- 699-" UNTIL $inboxmsg[$n]="" ?"- 700-" ?"- 701-" $startline = 8 - ($n/2) ?"- 702-" $startcolumn = 37 - len($inboxmsg[1])/2 ?"- 703-" ?"- 704-" COLOR y+/n ?"- 705-" box ($startline-1,$startcolumn,$startline+2*$n-1, ; -------> Warning KIXSTRIP: 705 line incomplete "left parenthesis". ; -------> Warning KIXSTRIP: 705 line incompleted. ?"- 706-" $startcolumn+len($inboxmsg[1])+3,$boxstyle) ; -------> Warning KIXSTRIP: 706 line incomplete "right parenthesis". ; -------> Warning KIXSTRIP: 706 line incompleted. ?"- 707-" ?"- 708-" COLOR c+/n ?"- 709-" $n=1 ?"- 710-" DO ?"- 711-" ?"- 712-" at ($startline + 2*$n - 1 , $startcolumn+2) $inboxmsg[$n] ?"- 713-" $n=$n+1 ?"- 714-" UNTIL $inboxmsg[$n]="" ?"- 715-" ?"- 716-" at(22,1) ?"- 717-" $n=1 ?"- 718-" DO ?"- 719-" $inboxmsg[$n]="" ?"- 720-" $n=$n+1 ?"- 721-" UNTIL $n=10 ?"- 722-" RETURN ?"- 723-" ?"- 724-" ; -------- End of functions repository -------------------------------- ?"- 725-" ?"- 726-" ?"- 727-" :end ?"- 728-" COLOR w/n;($begin) ; ; tue 15-aug-2000 11:48:59 ; ;Informative KIXSTRIP: no errors found. ; ;Warning KIXSTRIP: 1 block is incompleted. ; missing "do/until", "if/else/endif", "while/loop" ; "select/case/endselect" statement. ; - do/until [22:22] ; - if/else/endif [72:37:73] ; - select/case/endselect [4:11:4] ; - while/loop [13:13] ;Warning KIXSTRIP: 8 lines are incompleted. ;Warning KIXSTRIP: some lines contains errors or possible errors. ; 4 line incomplete "left parenthesis". ; 4 line incomplete "right parenthesis". ; 1 block "if/else/endif" incompleted. starting point of block structure missing. ; 1 block incompleted. ; 8 line incompleted. ;Informative KIXSTRIP: 111 block_structures found. ;Informative KIXSTRIP: 22 labels found. ;Summary KIXSTRIP: CALL EXIT GOSUB GOTO QUIT RETURN RUN SHELL USE ;Informative KIXSTRIP: 14 GOSUB ;Informative KIXSTRIP: 52 GOTO ;Informative KIXSTRIP: 3 RETURN ;Informative KIXSTRIP: 8 SHELL ;Informative KIXSTRIP: 2 USE ; ;($end) ;($begin) ; ;Warning KIXSTRIP: 487, 522, 544, 705 line incomplete "left parenthesis". ;Warning KIXSTRIP: 488, 523, 545, 706 line incomplete "right parenthesis". ;Warning KIXSTRIP: 61 block "if/else/endif" incompleted. starting point of block structure missing. ;Warning KIXSTRIP: 61 block incompleted. ;Warning KIXSTRIP: 487, 488, 522, 523, 544, 545, 705, 706 line incompleted. ; ;($end)
code:
Kixstrip 3.62 (vs 1.70e) (c) MCA - scripting@wanadoo.nl - 2000 1 .....................................E(728) Warning KIXSTRIP: 487, 522, 544, 705 line incomplete "left parenthesis". Warning KIXSTRIP: 488, 523, 545, 706 line incomplete "right parenthesis". Warning KIXSTRIP: 61 block "if/else/endif" incompleted. starting point of block structure missing. Warning KIXSTRIP: 61 block incompleted. Warning KIXSTRIP: 487, 488, 522, 523, 544, 545, 705, 706 line incompleted. Kixstrip 3.62 (vs 1.70e) 6.82 (sec) input 728 network.kix output 728 network.new block_check -ERROR- block_errors_count=1 block_structures=111 labels=22 tab=6 (default) Warning KIXSTRIP: 1 block is incompleted. missing "do/until", "if/else/endif", "while/loop" "select/case/endselect" statement. - do/until [22:22] - if/else/endif [72:37:73] - select/case/endselect [4:11:4] - while/loop [13:13] 111 block_structures found. Warning KIXSTRIP: 8 lines are incompleted. options: /Block_Check /Debug /Headers /NoCombine /Print /Show_Errors /TAB=6 /Translate /NoLicense: (not.specified)
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 611 anonymous users online.
|
|
|