npocmaka / batch.scripts

batch script utils and examples by npocmaka -
https://www.linkedin.com/in/npocmaka/
MIT License
1.07k stars 874 forks source link

Bugs in find function fixed #46

Closed sebetci closed 2 years ago

sebetci commented 2 years ago

1. Problems and Suggestions

1.1. README.md

There isn't rule for naming functions, variables, folder and files in the repository.

1.2. dataStructures/binaryTree.bat

  1. The find function in dataStructures/binaryTree.bat produces the following error: !test_tree6! was unexpected at this time.

  2. The find function returns 1 even if the searched value is in the tree.

  3. The node variable is not used in the find function .

  4. The find function only searches the first node of the tree.

1.3. DateAndTime/DateParts.bat

This script does not work on Windows 10 operating system.

1.4. DateAndTime/W32DOW.bat

The source code isn't documented.

1.5. DateAndTime/W32tmSleep.bat

The source code isn't documented.

1.6. DateAndTime/getTime.bat

The source code isn't documented.

1.7. DateAndTime/sleeptp.bat

The source code isn't documented. The time output format isn't clear.

2. Solutions and Suggestions

2.1. README.md

2.2. dataStructures/binaryTree.bat

  1. Updated !%1! in find method to %1.

  2. The following change was made within the find function:

:: The second parameter is checked instead of the first parameter.
IF %VTreeName% EQU %2 ( ... )
  1. The node variable has been removed from the source code.

  2. I haven't developed a solution to this problem yet.

2.3. DateAndTime/DateParts.bat

2.4. DateAndTime/W32DOW.bat

2.5. DateAndTime/W32tmSleep.bat

2.6. DateAndTime/getTime.bat

2.7. DateAndTime/sleeptp.bat

3. Tests

The following scripts edited were run successfully on Windows 10 Pro operating system:

sebetci commented 2 years ago

The situation in issue #47 was addressed in this pull request.