Saturday, October 21, 2023

Emojis - Ruby Command Line Options 🖥️ for ICM InfoWorks Ultimate

 Command Line Options 🖥️

Ruby interpreter accepts the following command-line options (switches). They're largely similar to Perl's options.

  • -0digit 📖

    • Sets the input record separator ($/) as an octal number. No digits mean the null character is the separator. -00 initiates Ruby's paragraph mode. -0777 makes Ruby process an entire file as one string.
  • -a 🚀

    • Activates auto-split mode with -n or -p. In this mode, Ruby runs $F = $_.split at the start of each loop.
  • -c

    • Ruby checks the script's syntax and exits. If there's no error, "Syntax OK" is displayed.
  • -Kc 🈸

    • Defines KANJI (Japanese character) code-set.
  • -d, --debug 🔍

    • Enables debug mode. $DEBUG is set to true.
  • -e script 📜

    • Takes script from the command-line. Ruby won't look for a script filename in the arguments with this switch.
  • -F regexp 🔗

    • Determines input field separator ($;).
  • -h, --help

    • Shows a summary of the options.
  • -i extension 📝

    • Specifies in-place-edit mode. If provided, the extension is added to the old filename for backup.

    Example:

    % echo matz > /tmp/junk % cat /tmp/junk matz % ruby -p -i.bak -e '$_.upcase!' /tmp/junk % cat /tmp/junk MATZ % cat /tmp/junk.bak 
    matzk.bak matz
  • -I directory 📂

    • Tells Ruby where to load library scripts. This path is added to the load-path variable ($:).
  • -l 🔚

    • Enables automatic line-ending processing. It sets $\ to the value of $/ and uses chop! on every line when used with -n or -p.
  • -n 🔄

    • Makes Ruby assume a loop around your script, similar to sed -n or awk.
  • -p 🖨️

    • Similar to -n, but prints the value of variable $_ at each loop's end.
  • -r filename 📁

    • Requires Ruby to load the file. Useful with -n or -p switches.
  • -s 🔄

    • Enables parsing for switches after the script name but before any filename arguments.
  • -S 🔍

    • Makes Ruby use the PATH environment variable to search for the script.
  • -T [level] 🛡️

    • Enables "taint" checks. If a level is specified, it sets $SAFE to that level.
  • -v, --verbose 🗣️

    • Enables verbose mode. Ruby will print its version at the start.
  • --version 🆚

    • Displays Ruby's version.
  • -w 📢

    • Enables verbose mode without the version message. Sets $VERBOSE to true.
  • -x[directory] 🗺️

    • Indicates the script is embedded in a message.
  • -X directory 🗺️

    • Makes Ruby switch to the specified directory.
  • -y, --yydebug 🐛

    • Enables compiler debug mode. Useful for debugging the Ruby interpreter itself.

Parent topic: ICM Exchange for Autodesk ⚙️🔄

Emojis in SQL for ICM InfoWorks - Appendix A – Error Messages 🚫

 Appendix A – Error Messages 🚫

Handling SQL text involves a series of steps. If a problem arises during any step, an error message appears, and the process terminates. 🛑

Phases:

  1. Splitting into Keywords 🔍: This step breaks down the SQL text into keywords, field names, and other elements. If an issue arises, an error message starting with "error parsing query:" is displayed. Potential errors include:
    • Invalid character at the start of a token. ❌
    • Invalid character after field separator. ⚠️
  2. Handling and Splitting Clauses ➗: The SQL text is divided into clauses separated by semi-colons. The clauses are then numbered for easier error identification. Errors in this phase include:
    • Repeated use of a keyword within a clause. 🔁
    • Incorrect combination of keywords. ❎
    • Improper ordering of sub-clauses. 🔄
    • Invalid table names after specific keywords. 🚫
    • Incorrect syntax in SET clause. ⛔
  3. List Clauses 📜: Errors related to defining list clauses include:
    • Duplicate variable definition. 🔄
    • Invalid list format. ❌
    • Mismatch in data types within a list. ⚠️
    • Unrecognized date format in a list. 📅
  4. Scalar Assignments 📊: Errors during scalar assignments involve:
    • Duplicate variable definition. 🔁
    • Unrecognized date format. 📅
    • Excessive length of LET clause. ❎
    • Invalid data type assignment to scalar variables. ⚠️
  5. Handling Individual Clauses 🧐: During this phase, errors are reported with the clause number and the sub-clause name for clarity. Errors include:
    • Misplacement of equal sign. ❌
    • Unexpected comma. ⚠️
    • Incorrect bracket usage. 🚫
    • Invalid function names or parameters. ❎
    • Improper use of aggregate functions. ⛔
    • Incorrect use of the AS keyword. 🚫
  6. Checking Validity of Variable and Field Names ✅: Errors in this phase concern the validity of variable and field names. They include:
    • Unrecognized field names. ❌
    • Improper use of the asterisk (*). ⚠️
    • Misuse of list variables. 📜
    • Undefined variables. ❓
    • Mismatch in variable usage context. ⛔
    • Unrecognized date format. 📅

Additional Notes 📝:

  • Forgetting the dollar sign in variable names in a LIST clause will produce an error. 💲❌
  • If a query only defines list variables, a message indicating no actions will be taken is shown. 🚫

Copyright: Wallingford Software 2010 📄🔒

AI Rivers of Wisdom about ICM SWMM

Here's the text "Rivers of Wisdom" formatted with one sentence per line: [Verse 1] 🌊 Beneath the ancient oak, where shadows p...