Jump to content
Macro Express Forums

Recommended Posts

Hi,

 

I'm copying some fields from an application on which date format is in "mm/dd/yyyy" (ex. 03/01/2013)format but i want to customarize it to "mmmm dd',' yyyy" (ex. March, 01, 2013) format.

 

The above value is stored in variable T[1] through Variable Set String t[1] from clipboard contents.I guess the desired results can be acheived by using modify Date/Time --> convert to text variable option or maybe some better option. But as the variable is intialized from clipboard but modify date/time uses Date/Time Variable(that means an existing variable defined in date/time format to modify). Please advice is there some better option of converting the date into the desired format ?

 

Thanks in advance

 

Gagan

Link to comment
Share on other sites

Take the first 2 digits and do a select-case for the month name then take the 4th and 5th digit if the 4th is not a zero (5th only else) and then 7th thru 10th for the year. Then just put them all together in a new resultant string. Pretty simple really.

Link to comment
Share on other sites

Hmm, that raises an interesting puzzle here. I downloaded that macro file:

 

MEPro-FileOpeningProblem.jpg

 

On using File > Open File in ME Pro (4.4.1.1) I had a message I don't recall seeing before, namely that the file was 'from another computer' and was blocked for security. I clicked the Unblock button. But I'm still unable to access it. It's not shown in File > Open File > Browse. I even added extra Permissions but still not there.

 

Edit: I haven't solved that mystery but I did get the file into ME Pro by d-clicking. That loaded the new macro and nothing else, so I opened my main macro file Full.mex, moved the new macro into an appropriate category within it, then finally closed the new file.

 

But the macro seems buggy. Before running it I changed the example that the author used (11-12-12) to remove the ambiguity. I like days that are over 12 in this sort of demo! So lines 17-19 are now

 

// Put the date in T10 in MM-DD-YY format
// -------------------------------------------------------------------------------------
Variable Set String %DateString% to "11-15-12"

That gave the result 30/12/1899.

 

--
Terry, East Grinstead, UK

Link to comment
Share on other sites

I'm not sure if it's related but another poster found a bug in the time calculations that had a similar result.

 

But in this case the poster has string and needs a string so there's no need for all the complexity of converting to time variables.

Link to comment
Share on other sites

  • 4 weeks later...

The Date String to DateTime Variable describes how this is done. Put a Date/Time command in an empty macro. Change it to return the format you want. Click to view it in the Direct Editor. Compare the command in the Direct Editor with the command in the sample macro. Change where needed.

 

My guess is you need to change the Format="DD-MMM-YYYY" part. But you will need to read and then try it.

Link to comment
Share on other sites

  • 1 month later...

Hmm, that raises an interesting puzzle here. I downloaded that macro file:

 

MEPro-FileOpeningProblem.jpg

 

On using File > Open File in ME Pro (4.4.1.1) I had a message I don't recall seeing before, namely that the file was 'from another computer' and was blocked for security. I clicked the Unblock button. But I'm still unable to access it. It's not shown in File > Open File > Browse. I even added extra Permissions but still not there.

 

Edit: I haven't solved that mystery but I did get the file into ME Pro by d-clicking. That loaded the new macro and nothing else, so I opened my main macro file Full.mex, moved the new macro into an appropriate category within it, then finally closed the new file.

 

But the macro seems buggy. Before running it I changed the example that the author used (11-12-12) to remove the ambiguity. I like days that are over 12 in this sort of demo! So lines 17-19 are now

 

// Put the date in T10 in MM-DD-YY format

// -------------------------------------------------------------------------------------

Variable Set String %DateString% to "11-15-12"

 

That gave the result 30/12/1899.

 

--

Terry, East Grinstead, UK

 

 

I reported this apparent bug at the time and have today received confirmation that it will be fixed in the next version. At least, that's what I'd like to conclude from the following, despite its puzzling inclusion of an 'IF'!

 

Issue [iSS11698] submitted by you has been resolved. If a modification was made to Macro Express Pro to resolve this issue the change will be available with the next release of Macro Express Pro.

 

--

Terry, East Grinstead, UK

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...
×
×
  • Create New...