Shop OBEX P1 Docs P2 Docs Learn Events
data types, parsing etc — Parallax Forums

data types, parsing etc

s2jesses2jesse Posts: 62
edited 2008-06-16 07:14 in Propeller 1
I'll start with the obligatory im new to this stuff statement[noparse]:)[/noparse]

Im learning about data and working with it on a very basic level right now..

my current leanring task is to convert··the time string·from a gps...ive used numbers (FromStr) so i can preform math etc on it got that far but now trying to figure out how to grab sections of it..

its in HHMMSS not sure how to go about separating them so i can work with them ie separate it into an hours var, minutes etc and seconds vars.

When your new its difficult to search for some of these topics because i have no clue on a lot of the terminology so its hard to even find the right search terms.

Things only click when i actually preform the task once hands on.

I gotta say messing with the prop is super fun [noparse]:)[/noparse]





·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-16 06:28
    If you have a numeric value of the form HHMMSS, just use division (/) and the modulus operator (//) using 100 like
    value := original / 100 ' is HHMM
    seconds := original // 100 ' is SS
    minutes := value // 100 ' is MM
    hours := value / 100 ' is HH
  • s2jesses2jesse Posts: 62
    edited 2008-06-16 07:14
    ok great! wish i had more fundamentals... so i didn't have to bother anyone with simple questions[noparse]:)[/noparse]

    thanks
Sign In or Register to comment.