4 Replies Latest reply on Aug 18, 2007 4:55 AM by Newsgroup_User

    Does Lingo have a max integer limitation?

    Applied CD Level 1
      Way back in the dark ages I used to have to worry about integer values having an absolute maximum (for example, FORTRAN, Pascal, and BASIC all had an integer data type which was 8 bit and a long integer which was 16 or 32, I forget which) … anyway … I want to copy a file from CD to HD if the file on the CD is newer, Buddy API’s “IfNewer” option apparently only compares dates, not time (please correct me if I’m wrong about that). baFileAge will give me the age of the file in seconds from some arbitrary date but each year is 31.5x10^6 seconds, so now I’m worried about max integers.
        • 1. Re: Does Lingo have a max integer limitation?
          Level 7
          Yes there is a max integer..

          put the maxinteger
          -- 2147483647

          You can use floats to deal with numbers higher than that though.

          Also, Buddy's baFileDat will tell you the hours, minutes, and seconds if
          you ask it to.

          put baFileDate(the moviePath&"someFile.ini"m"dd-mm-yyyy ","hh:nn:ss")
          --"26-10-2006 09:12:58"

          You do not have to put in spaces, hypens, and colons like I did. You
          can make it just a long string of numbers that you can use to compare
          dates...

          baFileDate(the moviePath&"someFile.ini"m"yyyymmdd ","hhnnss")
          • 2. Re: Does Lingo have a max integer limitation?
            Applied CD Level 1
            Thanks Mike. I’m sorry I missed that in the help docs. For the curious, maxinteger in seconds translates to 68 years if I did my math right. I suppose that’s reasonably safe if baFileAge only returns integers, it all depends on the arbitrary start date (if it’s 1901 we’re in trouble ;-) but you’re right, yyyymmddhhnnss is a safer way to go.
            • 3. Re: Does Lingo have a max integer limitation?
              Level 7
              00:00 1/1/1900 is the date windows use as reference as well - at least for
              the method used for file date/time.

              "Applied CD" <webforumsuser@macromedia.com> wrote in message
              news:fa4i5f$4hf$1@forums.macromedia.com...
              > Thanks Mike. I?m sorry I missed that in the help docs. For the curious,
              > maxinteger in seconds translates to 68 years if I did my math right. I
              > suppose
              > that?s reasonably safe if baFileAge only returns integers, it all depends
              > on
              > the arbitrary start date (if it?s 1901 we?re in trouble ;-) but you?re
              > right,
              > yyyymmddhhnnss is a safer way to go.
              >


              • 4. Re: Does Lingo have a max integer limitation?
                Level 7
                >>00:00 1/1/1900 is the date windows use as reference as well - at least for
                >>the method used for file date/time.

                Good to know, but not what I'd have thought. I would've thought it'd be unix
                epoch time: 00:00 1/1/1970 just because it seems such a standard reference.
                Of course, maybe they didn't want to be like unix...



                --
                Dave -
                Head Developer
                http://www.blurredistinction.com
                Adobe Community Expert
                http://www.adobe.com/communities/experts/