Announcement

Collapse
No announcement yet.

PB9 undocumented keywords ? MMDDYYYY and YYYYMMDD

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

  • Kev Peel
    replied
    See: LISTVIEW SORT hDlg, id&, col& [,options...]

    Leave a comment:


  • PB9 undocumented keywords ? MMDDYYYY and YYYYMMDD

    Has anyone ran across this?

    Code:
    #COMPILE EXE
    #DIM ALL
    
    TYPE MMDDYYYY
       aMonth  AS STRING * 2
       aDay    AS STRING * 2
       aYear   AS STRING * 4
    END TYPE
    TYPE YYYYMMDD
       aYear   AS STRING * 4
       aMonth  AS STRING * 2
       aDay    AS STRING * 2
    END TYPE
    FUNCTION SDt(Indate AS STRING) AS STRING
       DIM TempD AS YYYYMMDD
       LSET TempD=Indate
       SDt=Build$(TempD.aMonth, TempD.aDay, TempD.aYear)
    END FUNCTION
    
    FUNCTION InvDt(Indate AS STRING) AS STRING
       DIM TempD AS MMDDYYYY
       LSET TempD=Indate
       InvDt=Build$(TempD.aYear, TempD.aMonth, TempD.aDay)
    END FUNCTION
    FUNCTION PBMAIN () AS LONG
       LOCAL A$, B$
       A$="08082008"
       B$=InvDt(A$)    'Should be 20080808
       ? "B$="+B$
       A$=SDt(B$)      'Should Be 08082008
       ? "A$="+A$
    END FUNCTION
Working...
X