nithyanantham Posted December 31, 2012 Report Share Posted December 31, 2012 can you please some one guide me how to add current date in macro express 3.5.5.2 version, i am unable to find out the Date in commands area. Quote Link to comment Share on other sites More sharing options...
acantor Posted December 31, 2012 Report Share Posted December 31, 2012 The first example is Macro Express code to produce the date in D M YYYY format. The code uses three integer variables, N1 (day), N2 (month), and N3 (year). In the second example, the date outputs as D MMMM YYYY. Variables N1 and N3 are reused, but I change the month from integer variable N2 to text variable T1. // D M YYYY Format: Variable Set Integer %N1% from Current Day Variable Set Integer %N2% from Current Month Variable Set Integer %N3% from Current Year Text Type: D M YYYY: %N1% %N2% %N3% // D MMMM YYYY Format: Switch (N2) Case: 1 Variable Set String %T1% "January" End Case Case: 2 Variable Set String %T1% "February" End Case Case: 3 Variable Set String %T1% "March" End Case Case: 4 Variable Set String %T1% "April" End Case Case: 5 Variable Set String %T1% "May" End Case Case: 6 Variable Set String %T1% "June" End Case Case: 7 Variable Set String %T1% "July" End Case Case: 8 Variable Set String %T1% "August" End Case Case: 9 Variable Set String %T1% "September" End Case Case: 10 Variable Set String %T1% "October" End Case Case: 11 Variable Set String %T1% "November" End Case Case: 12 Variable Set String %T1% "December" End Case End Switch Text Type: D MMMM YYYY: %N1% %T1% %N3% Quote Link to comment Share on other sites More sharing options...
Samrae Posted January 2, 2013 Report Share Posted January 2, 2013 Alan, Doesn't this do the same thing (but much shorter)? Date/Time: Save "d MMMM YYYY" into %T1% Text Type: %T1% Quote Link to comment Share on other sites More sharing options...
acantor Posted January 2, 2013 Report Share Posted January 2, 2013 I forgot about that! Good catch. If one needs the date in a format that MEX doesn't support, say DD-MMMM-YYYY-HH-MM or YYDMM, it's good to know how to build a script from first principles. Quote Link to comment Share on other sites More sharing options...
Samrae Posted January 3, 2013 Report Share Posted January 3, 2013 Your comment "date in a format that MEX doesn't support" made me curious so I studied help for the Date/Time command. There are a few predefined date/time formats but you can also type other formats in the Date/Time command. I cannot imagine a date/time format that Macro Express cannot do. Here are the two you mentioned: Date/Time: Save "dd"-"MMMM"-"YYYY"-"hh"-"nn" into %T1% Date/Time: Save "yydmm" into %T1% Note that "nn" is used for minutes because "mm" represents the month. Quote Link to comment Share on other sites More sharing options...
acantor Posted January 3, 2013 Report Share Posted January 3, 2013 I hadn't realized it was possible to type in a date format. I wish I had known that years ago. On the other hand, not knowing gave me more time to get familiar with Macro Express variables and conditional statements. The comprehensiveness of Macro Express still surprises me at times. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.