Jump to content
Macro Express Forums

randallc

Members
  • Posts

    434
  • Joined

  • Last visited

Everything posted by randallc

  1. Hi, Magic, I'm presuming you want to retrieve yesterday's date to delete yesterday's backup? That's already set if copy the "code" from this post. When you use the command (or double click on it in your macro having pasted it in ), you will see various options to set inside the "Text/Date/Time Format" command, including 4 boxes for "Days back, hours back, months back etc." (There are also options to use a certain date or to prompt at run-time as alternatives; you can change the date format in the top box)) Best, Randall <DT:m.d.yyyyT:02:3:{P00001}{P00000}{P00000}{P00000}><DOFILE:08:NN:c:\Backup\FolderName\*%T2%.txt>> (PS in the code you can see it as the first "{P00000}" option, which has been set to "{P00001}" (I'll try to add apicture here, but have not done it before, so may not work! Prompt Picture
  2. Hi guys, I think I have a simpler solution, as I found for my date/time differences macro; Dates Discussion The format is easier to set in Text/Date/Time command; <DT:m.d.yyyyT:02:3:{P00001}{P00000}{P00000}{P00000}><DOFILE:08:NN:c:\Backup\FolderName\*%T2%.txt> Best, Randall PS Here's a much more complex example; see my signature "Date Formats", links to explain;\EDIT2; updated file DatebillGap2.mxe
  3. Hi, Cory, Welcome! try this one for a start; no doubt many other ways! (Copy, Paste the code into script editor to see...) Repeat until %T10%="CANCEL" ....Variable Set %T10%="A" ....Multiple Choice Menu: Repeat Loop Prompt Repeat End (Note the tick box to cont macro with Cancel) Best, Randall <REP3:08:000001:000001:0010:0:01:CANCEL><TVAR2:10:01:A><MENU2:2:T:10:CenterCenter:Repeat Loop Promptpress Return to Repeat; else CancelRepeat?T><ENDREP><TBOX4:T:1:CenterCenter000278000200:000:Finished!Finished!>
  4. Hi, Floyd, Here is another simple form as an example using multiple text input and the date calculator (hidden fairly much in "MacroRun" statements.) The option to use the calendar to use 2 dates for the difference instead too, which I hadn't found before. What do you think? Best, Randall (PS - Only requirement is IE6, I think! - IE5 crashes vbscript in this, then ME- RUNS ON WinME, BUT PERHAPS NOT WIN98?) Please note also Form Making Library in separate post; Form Making Library DateTimeDifferencesHTAform.mxe
  5. Hi, Under "Macro Control" on menu; use "Macro Run" <MACRUN2:AdAware> (And "End If" after that!) Best, Randall
  6. Hi, I am no guru! but interested in data transfer. What program are you using that uses "columns" and "autofit"? A ".csv" is simply a "comma-delimited text file", isn't it? - So it has no columns unless you import it into something like Excel. How excel handles it is probably a question for an Office forum group! If you need to keep each string or item the same width each time it is entered, perhaps change each to a string, then "string modify "pad" a fixed amount with plenty of room before appending? Best, Randall (PS - If you "autofit" in excel, it may then change this? - Although I thought "Autofit" in excel only affected the screen display column width, not the saved column width in the saved file?) - Again, "How excel handles it is probably a question for an Office forum group!") Example; <TVAR2:02:01:abcde><TMVAR2:15:02:00:005:000:><TVAR2:03:01:9-09-2005 99:99:99><TMVAR2:15:03:00:020:000:><TVAR2:04:01:9-09-2005 99:99:99><TMVAR2:15:04:00:020:000:><DMVAR:05:02:1:000000000000005.0000:1:000000000000014.0000><TMVAR2:15:05:00:020:000:><REM2:Make sure all sizes are adequate?)>
  7. thanks,. Yes, Kevin, the "\s" is pesky! Because of the paragraph marks in those text boxes, I could not put the whole macro line in a string to edit out the CRLFs. I was trying to do that first in Word, but that seemed to randomly lose some of the CHR(1) ("\s"?), and I didn't realize at first. I think I was also having trouble with the %N99% in the field for date setting "days before" and had to add some "000000" to it. Here is my current macro to try to put, from the clipboard, a copied macro line into a string; what do you think? Has someone got something better worked out? There will always be some direct editing, no doubt, but at least this gets it in a string ready to look at! Best, Randall MacroRunStringMaker.mxe
  8. Thanks Kevin, I did not realize the \n was enough! I have not solved the problem yet! Are you able to do this with Text boxes and Multiple choice menus? I am not.. trying to add CRLF except where they already appear in these macros in these boxes (ie not.. "between" macro lines" as you say..); there must be some other way to handle them than \n, or it is not possible? Thanks, Randall
  9. Hi, everyone, I am having trouble putting some macros into variables or text files. I think I have tracked it down to the Carriage returns (?) in Text Box Displays and multiple choice commands. Is this not a "CRLF"?; "\r\n" does not help. Can anyone enlighten me? Thanks, Randall
  10. PS Robert - Have you considered running VMWare or similar, and running a second windowsXP (or eg Win2K) and macroExpress to do your main macro processing; then you can have the main WinXP and macroExpress free to do your terminal etc? Then you do have MacroExpress running twice? I am not an expert on VMWare and it may take some setting up of the processor time and speed sharing, but I imagine it is possible. I use VMWare for simpler things. Randall
  11. Hi, Robert,. My simple approach would be to go through your routine macro and add your lines with "If window...Macrorun(TerminalMacro)..End If" as often as you reasonably can. Perhaps you can include it inside some other (non-critical?)loops in other macros all over the place? - It will automatically pause till it returns to the "End If". If it will slow down some other loop("If" does not usually slow much), and you know how often it is running, have it check only every 50th recursion or similar. (Your terminal macro may have to set some other marker to include in your "if", if you only want it to run once. - eg in an environment variable which you can check with your "if Window".."AND".. "If var =" ( or NOT="?) ((Imagining... Then maybe also an "If Window NOT running" to reset the environment variable and be able to check again "if running"!)) I doubt you can get this done automatically any other way with MacroExpress; but I will be interested in Kevin's ideas. Best, Randall
  12. Robert, Again! Alternatively, if you can put the dates and times into strings T2 and T1: this would convert them to my format in ME3: uses MacroRuninVariable to put the date/time (with correct format) in Text/Date/Time formatter; <TVAR2:02:01:2/7/2005 8:41:40 AM><TMVAR2:01:02:00:000:000:><TMVAR2:21:02:00:000:000: \s><TMVAR2:09:99:02:000:000:><TVAR2:01:01:2/7/2005 8:44:53 AM><TMVAR2:01:01:00:000:000:><TMVAR2:21:01:00:000:000: \s><TMVAR2:09:98:01:000:000:><TBOX4:T:1:CenterCenter000278000200:000:T99=%T99% T98=%T98% ><TVAR2:34:01:<DT:yyyymmddhhmmsszzz\sT:02:2:%T99%>><TVAR2:36:01:<DT:yyyymmddhhmmsszzz\sT:01:2:%T98%>><RUNMACVAR:34><RUNMACVAR:36><TBOX4:T:1:CenterCenter000278000200:000:T99=%T99% T98=%T98% T2=%T2% T1=%T1%> [Edited Feb 9th 05 I have swapped the macro. Also input now more easily as usual Windows format (as above), and results into Environment Vars and Registry entries for later retrieval without preserving ME integers, etc. ] Best, Randall
  13. Hi, Robert, Thanks! Yes, though I can't picture how you're using the mE3 macro with all the rest! You could, theoretically, retrieve all the parts of your current format as strings, change to numbers, and substitute them in the appropriate integers etc in my macro; it depends how easy that would be. I have retrieved from the format I use the year, date , etc from the string. (using position in string, so I found things were always the same place; in your current format, you might need to find "\", ":" etc if some items are in varying places in the string (double figure/ single figure times, etc). I only really use the format to evaluate T5 and T6 , T7 and T8, and an "If" "And" for year, date, day would work in those "If" statements just as well (see the Rem statements). If you are using VBA or VBS in SQL or Access, you could use a date/time difference function anyway, I imagine? (not that I have looked into it!) I have actually edited the macro; the PGM check part only, and have re-loaded it above on the list (it had lost one line; its retrieval of its own calc). [Edited Feb 9th 05 PGM checker missing a line to tale D9 into N17; I have swapped the macro. Also input now more easily as usual Windows format, and results into Environment Vars and Registry entries for llater retrieval without preserving ME integers, etc. ] Best, Randall
  14. Hi, joe, Thanks for your interest! I should have commented if you are looking at the loop; N18 starts with current date, and (taking it off to find how many days back for date of last day of last month) keeps adding these to get the number to go back for previous last day of month! N17 starts with current date difference (pos or negative) to keep adding the last day number of the month, and finally give the date difference in days. The calculations before and after the loop otherwise are just boring hour/ date/ etc calcs. Best, Randall PS I have actually edited the macro; the PGM check part only, and have re-loaded it above on the list (it had lost one line; its retrieval of its own calc). This does not affect the basic mE3 part.
  15. Hi, Robert, I think I have a macro working which you could modify to do date/ time differences; let me know if it helps. Date / Time Differences Calculates these up to 60years back, down to milliseconds if set in approprate format To set your own , format "yyyymmddhhmmsszzz" from text/ Date/Time input to string [Feb9th; now uses usual Windows format]; "m/d/yyyy h:m:s AMPM" or "mm/dd/yyyy hh:mm:ss", but watch your Regional Date settings! This macro prompts for number of days/ years back etc,and checks against current date/ time. It can be used to input your own start and end date/ time in %T1% and %T2% instead of prompting for days back. It works by calculating number of months to go back, then asking for date of last day of last month and adding it to date difference, looping through for date of end previous month etc... and adding, till it reaches month needed . The PGM Function library is NOTneeded, but can be selected to check after macro runs (only checks date calculation, not time! (Only use PGM Function library part if installed) Best, Randall Edited Feb 9th 05 PGM checker missing a line to tale D9 into N17; I have swapped the macro. Also input now more easily as usual Windows format, and results into Environment Vars and Registry entries for llater retrieval without preserving ME integers, etc. Edit Apr27th05 - This macro crashing out?; I have re-uploaded it. Please tell me if problems? Randall DateTimeDifferences.mxe
  16. Hi, Paul, In old newsgroups; where do I find this in PGM functions? Thanks, Randall
  17. Hi Floyd, Hey, that's great! I love seeing what people can do who know what they're doing and making it all look simple! - I can learn from your simplified routines. Keep it coming! Best, Randall
  18. Hi, Les, Yes, I agree that the text file process seems to be heaps faster for huge strings, and Floyd has posted his revised sort program using the vbscript equivalent of text file process, making things so much faster. I have posted the csv file processor which reads the whole file as one line (slows things down in vbscript too), and I have got the text file process (vbscript) going for text files, 1.8Mb file loads, sorts, saves, in 3 secs! (same process as Floyd is now using, and I think his would do the same). I'll post it if you want. Best, randall
  19. Hi, That looks amazing for what you need; Please see my revised sort above too, and let me know what you think? Can you use something like Excel etc for your data for sorts? - or too hard to automate? Best, Randall
  20. Hi, here are the examples; Best, Randall ExampleCSVfiles.zip
  21. Hi, Floyd et al! I am posting another macro like the Sor Single of Floyd's; taking his advice to avoid the registry for sorting, but saving the macro extra time. I still use the registry just for timing and to handle passing the indices to Quicksort. All his options other than "Descending" are not working on loaded files. The macro prompts for a"cvs" file to load from a directory. it will use a "txt" file if you force it, but won't work at present unless comma-delimited anyway. Please ask if questions. It may compete with the "almost sort" in speed (2000 by 300 takes 10 secs, mostly load file time!, 1-2 secs to sort, I think). The slowing down after about 140K is still related to having sucha big string in memory, and would need arrays or somewhere else such as registry to use to sort, i think. Why would the huge files not be just loaded into Excel and sorted there? Most ME3 sorts would be on small lists, I would expect? Best , Randall (PS reply shows zipped files of example "cvs" Please let me know if not working on other machines?) SortVBS.mxe
  22. Hi, See another link; those indices might help, but I had only thought about a 6 hour gap, so did not have to take month dates into account. My Webpage PGMacro utility program is your best bet, I think, as there's an inbuilt time diffference function. (I haven't used it, though!) Wouldn't this be easier in excel itself with vba macro or formula? not that I'd know! Best, Randall
  23. Hi, Yes, I await Floyd's thoughts with interest. I have made a new .vbs script which handles arrays written to the registry (crude version not ready to attach yet!; string type vbs is not working in it despite the menu option!) to avoid the strings. I think I can speed things up by only ever once having to make the vbs script, check each run that it exists too. (and no need for mxe file) How have you been handling your lists? - in txt files? I have had to avoid large strings and write individually to notepad if the strings would be larger than 16K. Best, Randall
  24. Hey, I like it, anyway! It can get some wrong, but format would fix it. ME looks at it as astring, left to right, so; 1. 1/22/2005 7:52:40 AM, 1/22/2005 7:48:07 PM wrong (Need AM before hour) 2. 12/22/2004 7:48:07 PM, 1/22/2005 7:52:40 AM wrong ("2" of 12 month>"/" slash) etc 3. Format yyyy/MM/dd AMPM hh:mm:ss would fix it 4. 2004/12/22 PM 07:48:07 , 2005/01/22 AM 07:52:40 OK! Best, Randall <DT:yyyy/MM/dd AMPM hh:mm:ss T:01:1:><DT:MM/dd/yyyy hh:mm:ss AMPM T:03:1:><IDELAY:2><DT:yyyy/MM/dd AMPM hh:mm:ss T:02:1:><DT:MM/dd/yyyy hh:mm:ss AMPM T:04:1:><IFVAR2:4:02:4:T1><TBOX4:T:1:000373Center000433000200:000:Tell me that the ending date (T2) is greater than the starting date %T1%=T1 ........(ie %T3%(T3)) %T2%=T2 ........(ie %T4%(T4))><ELSE><TBOX4:T:1:CenterCenter000278000200:000:Tell me that the ending date is NOT greater than the starting date %T1%=T1 %T2%=T2><ENDIF><TVAR2:01:01:1/22/2005 7:52:40 AM ><TVAR2:02:01:1/22/2005 7:48:07 PM ><IFVAR2:4:02:4:T1><TBOX4:T:1:CenterCenter000278000200:000:Tell me that the ending date (T2) is greater than the starting date %T1%=T1 %T2%=T2><ELSE><TBOX4:T:1:CenterCenter000278000200:000:Tell me that the ending date (T2) is NOT greater than the starting date %T1%=T1 %T2%=T2><ENDIF><TVAR2:01:01:2005/01/22 AM 07:52:40 ><TVAR2:02:01:2005/01/22 PM 07:48:07 ><IFVAR2:4:02:4:T1><TBOX4:T:1:CenterCenter000278000200:000:Tell me that the ending date (T2) is greater than the starting date %T1%=T1 %T2%=T2><ELSE><TBOX4:T:1:CenterCenter000278000200:000:Tell me that the ending date (T2) is NOT greater than the starting date %T1%=T1 %T2%=T2><ENDIF>
  25. Hi, Floyd, I had time on holidays to get the Quicksort working in MacroExpress; fiddly! I thought you might be interested; it starts from generating an example array, and gives the option of seeing the result from your vbs script to compare. not so many options as you gave! best, Randall. (A zipped file needs you to open the macro file (or import I suppose) A number of interlinked macros; "Alt-Cntl-"O"" "O"pens it!) Here's the main quicksort sub; The ME version stays under 3seconds up to 100 elements (no loading/ saving?, so faster than vbs version from ME, which is always 3-4 secs even for 2 elements!), then becomes slower; 10 seconds for 200 (vbs 4secs), 50secs for 1000; (vbs5secs!) I suppose it still may useful if you wish to stay in ME, and are only doing small sorts (<100!) The zip file has screen pics of the menus in Word doc. btw, How do you you add pics to these emails? "http" needed at website location? macexsorterOnly4.zip
×
×
  • Create New...