ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

time in rpg free?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • time in rpg free?

    How do I compare the system real time with a numeric value held on file in rpg free?

    I thought I could use %time but this isn't the same type?

    Thanks
    www.midlifegamers.co.uk

  • #2
    Re: time in rpg free?

    Convert the numeric value to time using the %TIME() BIF and then compare.
    PHP Code:
    D TimeFld        s            t
    TimeFld_ISO 
    = %TIME(FileTime:*USA); 
    Philippe

    Comment


    • #3
      Re: time in rpg free?

      You want to compare a numeric time with the current time?

      Try:
      Code:
       /Free
          // 1. Convert System time into numeric Time HHMMSS
          NumSysTime = %Dec(%Time(): *ISO);
          If MyNumTime = NumSysTime;
         
          //2. Convert numeric Time (HHMMSS) into a real time
          RealTime = %Time(MyNumTime: *ISO);
          If RealTime = %Time();
      /End-Free

      Comment


      • #4
        Re: time in rpg free?

        Hey that's great. Just had to split the HHMM from the HHMMSS but otherwise not a problem

        Many thanks to you both.
        www.midlifegamers.co.uk

        Comment

        Working...
        X