Loading ...
Sorry, an error occurred while loading the content.

MOD function

Expand Messages
  • marianne976
    Dimitris One question about the MOD function. If one does something like say 7%2 the function works perfectly. As soon as one changes the top value to a
    Message 1 of 5 , Dec 1, 2006
    View Source
    • 0 Attachment
      Dimitris

      One question about the MOD function. If one does something like say 7%2
      the function works perfectly. As soon as one changes the top value to a
      variable for example $($a%2) Gui4Cli generates a code 20 error. Yes I
      made sure that variable a has a value, is not an empty string.

      Am I doing something. Wrong?

      Thank you for your assistance.

      Frans.
    • r1pp3r_on_y4h00
      ... 2 ... a ... In my experience of using the modulo function, when you use a variable like the one above you should leave a space between the varable and
      Message 2 of 5 , Dec 1, 2006
      View Source
      • 0 Attachment
        --- In gui4cli@yahoogroups.com, "marianne976" <marianne976@...> wrote:
        > One question about the MOD function. If one does something like say 7%
        2
        > the function works perfectly. As soon as one changes the top value to
        a
        > variable for example $($a%2) Gui4Cli generates a code 20 error. Yes I
        > made sure that variable a has a value, is not an empty string.
        >
        > Am I doing something. Wrong?

        In my experience of using the modulo function, when you use a variable
        like the one above you should leave a space between the varable and
        operator like this.. $($a % 2).. this is because G4C seems to take the
        modulo character as part of the variable name. I had some trouble with
        this while writing Beatbox audio player, which contains an example of
        this. You can find Beatbox in the file area if you want to take a look.

        Graham
      • Dimitris Keletsekis
        ... Yes, as Graham says, its not recognised as an operator (probably because I added it later) - I ll fix it. Dimitris
        Message 3 of 5 , Dec 2, 2006
        View Source
        • 0 Attachment
          > > variable for example $($a%2) Gui4Cli generates a code 20 error. Yes I

          > like the one above you should leave a space between the varable and
          > operator like this.. $($a % 2).. this is because G4C seems to take the
          > modulo character as part of the variable name.


          Yes, as Graham says, its not recognised as an operator (probably
          because I added it later) - I'll fix it.

          Dimitris
        • marianne976
          Dimitris and Graham Thank you for the quick response. It helps me a lot. Frans
          Message 4 of 5 , Dec 2, 2006
          View Source
          • 0 Attachment
            Dimitris and Graham

            Thank you for the quick response. It helps me a lot.

            Frans


            --- In gui4cli@yahoogroups.com, "Dimitris Keletsekis" <gui4cli@...>
            wrote:
            >
            >
            > Yes, as Graham says, its not recognised as an operator (probably
            > because I added it later) - I'll fix it.
            >
            > Dimitris
            >
          • Dimitris Keletsekis
            Hmm.. The % character is used in fieds so it has other reprecusions when I change the code to make it recognised as an operator.. For now I ll leave it like
            Message 5 of 5 , Dec 3, 2006
            View Source
            • 0 Attachment
              Hmm.. The "%" character is used in fieds so it has other reprecusions
              when I change the code to make it recognised as an operator..

              For now I'll leave it like it is and mention it in the manual..

              Dimitris
            Your message has been successfully submitted and would be delivered to recipients shortly.