Jump to content
Macro Express Forums

Setting dates based on a starter date


NeVeR
 Share

Recommended Posts

I'm making a macro for a planing system we use in work.

 

When we get an project on .. lets say Monday 1st - We know what the next 8 steps of that project is .. as it's the same every time.. We keep all this data in a wiki.. and each time we have to type it out by hand.

 

What i want is to make a macro that will do the hard work.

 

I have the macro promote me for the data i need to start.. Like Project number is stored in T1 and persons name in T2.. then i promote for the date and add it to T3.

 

This is where i'm stuck.

 

If i set Monday 1st as my date I need the macro to be able to know what dates the other steps should be done.

 

So example

 

1: Project start - Monday 1st Oct

2: Project sent to review - Tuesday 2nd Oct

3: Review complete Send to be built - Wednesday 3rd Oct

 

etc..

 

idealy I want to be able to store the dates in T tags so i could use the text type tool to pre-write what i wanted. and add the dates.

 

This should work off a normal calender. So if i set my start date to 30th of Oct if would know to do the macro into Nov.

 

 

So in brief.. I want to be able to add plus one or plus two days etc to my start date.. and have them store in T tags.

 

Can this be done ?

 

thanks.

 

Link to comment
Share on other sites

Hi,

 

This says

"What it does:
This sample macro shows how to change a date from MM-DD-YY to DD-MMM-YYYY format using the 'Run Macro in Variable' command."

 

Thats not what i'm asking for.

 

I need to be able to set dates into the future from a given start date.

 

So lets say today it's the 1st of the month.

 

I run this macro and i'm promoted to select the start date of my project. Lets say the start date of my project is 15th.

 

This Macro will then know that the 15th is the 1st day.. and will know the 2nd day is the 16th / 3rd day the 17th etc.. I need it to set these new days into %T% tags so I can use the dates in a text type script.

Link to comment
Share on other sites

Here is an example of the what i mean

 

Macro starts and asked for project name ( I can do this part )

Marco prompts for Project start date and stores in T1 ( and anything ) --- Macro logic will run and return the following in text type.

 

 

Project Name ( from prompt )

Copy & SEO Details complete ( this will be the date i selected from the prompt ) :
Ready for Review: + 1 day from selected date
Review complete: +2 days from selected date
Send to translation +3 days from selected date
translation complete:+8 days from selected date
Graphics complete: etc
Load translation /Graphics to CMS: etc
translation Review complete:etc
QA Complete: etc

 

The macro needs to know weekends don't count as working days.

Link to comment
Share on other sites

This says

"What it does:

This sample macro shows how to change a date from MM-DD-YY to DD-MMM-YYYY format using the 'Run Macro in Variable' command."

 

Thats not what i'm asking for.

I suggested that sample macro because I thought the technique described, setting a date format using the "Run Macro in Variable" command, could be adapted to what you need.

Link to comment
Share on other sites

It would be nice being able to do time based math in ME.

I would suggest writing a new macro that you can call in your current one (to keep it cleaner).

Go to text->date/time and prompt user for date. Make sure you know what format you're using.

Use variable->modify string (copy part of text into variable value 3 characters 2 would turn the selected variable into 15 for 08/15/2012)

Do this for all 3 dates and you'll have numbers you can start working with and modifying.

in the new macro for the date math you'd have set up 3 variables, use an if statement to check what month it is and if the day goes over 30 for the appropriate months, it adds 1 to the month code also. Then set each of the new numbers into a set of variables to call in your main script on writing the new date.

 

The best solution would be to use from the current day. Then you can just use text-> date then set one variable for number of days into the future, etc. But this only works from the current day, if that can be changed combining date/time's promp and date's days into the future setting then it would be better, but I don't know how that can be done.

 

If you're willing to change todays date on your system to the first day you want to use, it'll work better, but that's also more work.

I think it also depends on how you want it displayed. June 16, 2012 or 06/16/2012 etc.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...