Sprintf("Error evaluating expression > %s\n", err.message) Sprintf("Expressions successfully evaluated!") % otherwise we throw an error -> typos and other stuff can go wrong! % To be safe, we evaluate if the instructions are valid, ![]() % some time defining some error-checking logic. % operations are absolutely valid before proceeding. % Define all the necessary operations as strings. % Create your two arrays and additional variables Keep in mind that the eval function has its own risks % Clean your workspace ![]() Please take this part of my proposal with a grain of salt and make sure that the instructions that you are evaluating are syntactically valid. ![]() ![]() Please consider the following approach as a referenceįirst, your arrays and operations can be defined as strings, which are then evaluated.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |