Menu

FAQ #3: Functions and Features

Help
Anobium
2013-11-08
2023-04-27
  • Anobium

    Anobium - 2013-11-08

    Great Cow Basic is feature rich. And, yet it has some public functions and features that are not fully documented, as yet. They include:

    Swap4
            A function that swaps (or exchanges) nibbles (4-byte blocks).

    SWAP
            A function that swaps (or exchanges) one byte or word for another. SWAP support the use of byte and word variables.

    ABS
            A function that returns the absolute value of an integer number.

    Average
            A function that returns the average of two numbers. This only supports byte variables.

    TRIM
            A function the trims a string variable. This therefore removes spaces as the start and end of a string.

    LTrim
            A function the trims a string variable. This removes spaces as the start of a string.

    RTrim
            A function the trims a string variable. This removes spaces as the end of a string.

    Gotchas:

    Things that do not work as expected.

    When using the functions STR() or HEX() do not leave space between the function call and the left brace. You will get a compiler error that is meaningless.

        ' use this, note this is no space between the STR and the left brace!
        STR(number_variable)
        ' do not use, note the space!
        STR (number_variable)
    
     
  • LionelXL

    LionelXL - 2023-04-27
     

    Last edit: LionelXL 2023-04-27

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.