Jump to content
Macro Express Forums

randallc

Members
  • Posts

    434
  • Joined

  • Last visited

Everything posted by randallc

  1. Hi, I am not expert on PGM, and have not tested that; I think in the previous macros it would have worked using {Date Julian} with the "20050531" and then {Julian to Date} with your format; ie I think 2 commands. Best, Randall EDIT -see below; not so!
  2. EDIT - Source code now included in ZIP file with "exe" and MEBasic SEE instructions for self- compiling script or reading it yourself, as in other thread; Wizard instructions for Script, compile if needed EDIT- Aug1st 05- up to v 5.5.3 EDIT- July12th- Got It - Really! Got It - Really! Best Randall MEbasicWizard.zip EDIT-July 9th; 5.1.3; WeekdayDifference returned to function; compares with Excel WkDAy counter EDIT-July 5th; 5.0.9;debugged again; DateStamp for changing File Time Stamp EDIT - July 3rd - Dates again fixed! - should work anywhere, and not cause a crash if wrong. - Folder Picker, Execl Cell Read/ write EDIT - July 4th- Wizard was calling it "MEBasic1" *** WINDOWS 98 work OK now I have been organising a Wizard" for the MEBasic commands, and was going to add PGM commands to make it easier to write macros with them; I won't bother if it's already underway with a new version? - Are you able to let me know what is planned and what is not? Thanks, Randall Instructions on this thread Display screen with Date Parse Display, larger I'll keep the most recent attempt in this post. EDIT - this post has been moved from another site; I'll re-post with the zip with "Wizard Start" macro included; you will need latest MEBasic MEX to test it reasonably at present. BasicME Lite Discussion EDIT June5th- fixed PGM Parse partly; correct number of tokens (not neg), some whitespace functionality; stopped crash with too many tokens EDIT June10th - more funcs; DateDiff, bigger Display; new button 4.8.3 EDIT June12th - FileDate, IncToday 4.8.5 (sorry wrong file uploaded on 10th, not "exe" EDIT June14th - fixed crashes?; IncFileDate, 4.8.6s ** SHOULD work for any date input format now and convert, USA or INTERNATIONAL EDIT June14th; ** now has included Text Picker to return text line from listbox to ME3 EDIT June15th; corrected install path?/ close each time else doesn't pick new text file EDIT June15th; more bugs; focus now on list in TextLinePicker EDIT June15th; Slicker, doesn't need to close, list faster (check version should be 4.9.0) EDIT June16th; tempted to take it down; but text picker inconsistent; use for other issues only EDIT June16th;text picker exits each time again (inconsistent if open), and works for files (?) up to 4096 lines only? cf Companion ME Basic; EDIT June17th; Oh dear; messed up another directory; fixed "copy to me"; could paste from clipboard anyway?//added Text Filepicker and MultiFilePicker macros BasicME Lite Discussion ***WINDOWS 98 work OK now !!! EDIT - Source code now included in ZIP file with "exe" and MEBasic SEE instructions for self- compiling script or reading it yourself, as in other thread; Wizard instructions for Script, compile if needed MEbasicWizard.zip File link at top now
  3. Here it is with PGM Macros; I am not good at these yet! See Floyd's code below; thanks Randall
  4. Hi, If you can catch the variable just as it is handed to the Julian Date macro [and back!] (and show me), i can probably check. (Are you catching result from "AnswerString" Env variable?) The other issue is output, which needs be set in format commandsl; JulianToDate$[dd/MM/yyyy,2453737] (? set as you need it at the end of your macro) - I had left it as "Long Date" as set in the registry I think! - but could be changed manually DateJulian(19 05 2005); only accepts this way around so far Don't forget the program is only really checked for international date formats, and not checked for the other way around (throughout, probably) so far! So "01 06 2005" will be handled as June; i presume you are in the US? Sorry it may not all be ready for you to use in this context. Best, Randall See also my other post;
  5. Hi, That should be correct,except for T1, D1, (and maybe T10 in the early versions) You could save them first elsewhere and restore separately (Registry, text, Environment vars etc) I would emphasise that this is only rudimentary in terms of reliability; more for "proof of concept" and to fill in the gaps really temporarily Best, Randall
  6. Hi, Cory, I'm enthusiastic about the "BasicME" approach ("proof of concept"!), even though it is only for fun and not serious application; I took your case as an example and stimulus to get "InStr$" and "StringSplit$" working; see example macro below (needs v 3.3s) Best, Randall <REM2:Parsing a filename Example using "Basic ME" ! -Randall <randallc@ozemail.com.au> Mainly for fun; still lots of bugs, I imagine; not for serious work? (Yo Use the mex file from Forum))><TVAR2:03:01:\\server\share\dir1\dir2\dir3\dir4\last, first 333-22-4444.pdf><REM2:Parse to Env vars as named; Quotes around any commas for Basic ><TVAR2:01:01:StringSplit$["%T3%",\,Directories]><MACRUN2:{_Basic ME Lite1}><REM2:Find last ("characters between rightmost "\" and rightmost ", ")><TVAR2:01:01:BtwCharMid$["%T3%","\",-1,0,", ",-1,0]><MACRUN2:{_Basic ME Lite1}><TVAR2:04:01:%AnswerString%><REM2:Find first ("characters between rightmost ", " and rightmost " ")><TVAR2:01:01:BtwCharMid$["%T3%",", ",-1,0," ",-1,0]><MACRUN2:{_Basic ME Lite1}><TVAR2:05:01:%AnswerString%><REM2:Find code (assume fixed length)><TVAR2:01:01:RelMid$["%T3%",-15,-5]><MACRUN2:{_Basic ME Lite1}><TVAR2:02:11:_%Parameter12%_Display><TBOX4:T:1:000239000254000532000391:000:StringDisplay2CODE=%AnswerString% T3=%T3% T4=%T4% T5=%T5% _%Parameter12%_Display= %T2%> EDIT posted 3.4s; fixed for quotes around strings with commas
  7. Apologies - This will be because of my date formatting (ie not really a "bug" to report) ; I was trying to put in validation for local date settings, but obviously was not able to test my US date validation (which you would need?) I did mention this in the first post " ("(US shortDate input commands not done yet; only international (eg 25/05/2005, NOT 05/25/2005)") but you may be able to fix it manually in the line which sets formatting (in the first few lins , "T98" Variable Set String %T98% "dd mm yyyy" to Variable Set String %T98% "mm dd yyyy" (note in this little macro example, no slashes) or, better <REGRSTR:98:HKEY_CURRENT_USER\Control Panel\International\sShortDate><TMVAR2:21:98:00:000:000:d/dd/><TMVAR2:21:98:00:000:000:ddddd><TMVAR2:21:98:01:000:000:/ > Sorry again, Randall (My first attempt at catching this error is in {DateTypeCheck}, so far only called for validation by one function, "IsWkDayDiff$". If you don't mind the crash, perhaps you could run that for me sometime?)
  8. No - The PGM macros will not work unless installed (I think), but these macros do not use them. Here is a new file with only my macros Randall I have changed the file on the original post too, when I've checked its working. There is a translation of the PGM function date macro you were looking at in v2_9s (BasicJulianMYPGM) EDIT - NOTE the newer file at beginning of thread is better, and will keep being updated; ME Basic update Basic_ME_Lite2_9s.mex
  9. Hi, I realise I included the "PGM" macros in there, and THOSE are protected. Perhaps you are looking at those ; perhaps create a "category" for them and put them in it. EDIT; I was going to re-post without my other macros in it Randall PS - actually, I can't delete PGM macros; perhaps sort by date, and put mine (all including and since 15th May) in one category
  10. Hi, Thanks for looking! I don't know! - Joe? - Why are they password protected for (at least one) others? It's OK if I download them. Do you have a newer version of 3.5c ME? Randall
  11. Hi, try Basic for ME? (What, tongue in cheek?) calculations on 1 line; all in ME alone.(now with some scrips requiring "Wizard" external) EDIT - Source code now included in ZIP file with "exe" and MEBasic SEE instructions for self- compiling script or reading it yourself, as in other thread; Wizard instructions for Script, compile if needed EDIT- July12th- Got It - Really! Got It - Really! Oh Dear Again! FIXED (please!) in 5.2.2. Looks as though no-one else will have had it running either! I have been lucky on my machines that I had another "ini" file present (left over from another program) AND a test file (test123.txt, with anything in it!) which saved me from the error. Best Randall MEbasicWizard.zip EDIT; July 5th; all edits on Wizard thread now ("alt-Shift-A" for examples) [Not tested much, minimal validation input, but fun] Best, Randall ME Math function examples.JPG ME string date function examples.JPG ME Basic Commands (US shortDate input commands ARE done now; were only international (eg 25/05/2005, NOT 05/25/2005) eg BtwCharMid$[str,chs1 , ins1, off1,chs2 , inst2, off2] Btw; mid$ between those characterstrings found IncCharMid$[str,chs1 , ins1, off1,chs2 , inst2, off2] Inc; mid$ including those characterstrings found IsDateDiff$[Date1, Date2,1] (num=2 gives week days) IsWkDayDiff$[ Date1, Date2] Week day difference Left$, CharLeft$, Right$, CharRight$, Mid$, RelMid$, CharMid$, BtwCharMid$, IncCharMid$, Replace$, InStr$, Insert$, CharInsert$, AftCharInsert$, IsDaysFromToday$, IsDateDiff$, IsWkDayDiff$, JulianToDate$ IsDaysFromToday$,IsDateDiff$ ,IsWkDayDiff$ ,TAN , DateJulian, TodayJulian, PI, INT, ABS, RND0, RND2, RND3, INT, RAND, SQR, FRAC, REC, StringSplit$ Str ---string chs Character string in the string (find , replace etc) inst Instance of found string (neg, count from right; “0” all) offset Pos or neg number from found position The command syntax is; (see in Examples) eg Variable Set String %T1% "IsDateDiff$[23/07/2005,23/07/2007,1]" Macro Run: {_Basic ME Lite1} Input with any variables; output with %D1%, or env var %AnswerString%, or change output in {_Basic ME Lite} EDIT May 30th; changed 3_4s; copes better with commas using quotes EDIT June 5th; changed 3_7s; fixes in StringSplit display, Charinsert at beginning EDIT June 11th; minor bug fixes and included WebEdit button macro EDIT June 12th; bug "E" in quotes/ /FileDate macro/ Web Edit Macro better EDIT June 14th; bugs fixed?; IncDate macro/ ** Date validation; ** please let me know if still date problems ** SHOULD work for any input format now and convert, USA or INTERNATIONAL EDIT June 17th; fixed Wizard Start "Exists"; added Text Filepicker and MultiFilePicker macros cf Companion Wizard; Link for Wizard and newer MEBasic all in one ZIP now MEbasicWizard.zip EDIT -July 5th; all edits on Wizard thread now
  12. Thanks for the reminder; I used to understand that! Randall
  13. Hi, I think I have a bug in dates; <DT:ddT:03:1:><TMVAR2:05:03:02:000:000:><NMVAR:02:02:1:0000002:2:0000004><REP3:01:000001:000001:00010:1:01:><NMVAR:01:03:1:0000002:1:0000001><DT:dddd, d MMMM yyyyT:99:3:{P0%N3%}{F00001}{F00000}{F00000}><TMVAR2:07:01:00:000:000:|%N3%==%T99%><ENDREP><TBOX4:T:1:000277000257000458000263:000:firstT1=%T1%; > Gives 31st May is missing! Can anyone help? Best, Randall
  14. Thanks, Floyd! I can use another PGMacro library function to set the date format, though it does not like international date formats. (attached below) <REGWSTR:1:HKEY_CURRENT_USER\Software\Professional Grade Macros\Parameters\ParameterString1><MACRUN2:{ DateTime - Format Input String } ><REGRSTR:1:HKEY_CURRENT_USER\Software\Professional Grade Macros\Parameters\ReturnString1> (Nicer than ; <TVAR2:34:01:<DT:yyyymmdd000000000\sT:01:2:\x25BillDate(%N3%)\x25\s00:00:00> ><RUNMACVAR:34> I have also set a check for date format in the input function of my previous macros which do not use this. <REGRSTR:97:HKEY_CURRENT_USER\Control Panel\International\sLongDate> DatebillGap3.mxe (May need) DateDifferencesInput.mxe I can also use PGMacro library functions in my previous algorithm, if I like to avoid the “if/else/and” decimal components. JulianDate3.mxe They may make more sense than my algorithm (which actually only needs 1 date formula to calculate date differences (by Julian often otherwise) interestingly! DatebillGap4.mxe Best, Randall The “Date Differences” in PGMacros is from the "{ DateTime - Span of Days }” macro set; (Nicer than running my large variable macro; or running “DateDifferencesInput” as a separate macro) <TVAR2:01:01:{ DateTime - Span of Days }, %T2%, %T1% ><REGWSTR:1:HKEY_CURRENT_USER\Software\Professional Grade Macros\Pgm Functions\PgmFunction><MACRUN2:{ PGM Function } ><REGRINT:1:HKEY_CURRENT_USER\Software\Professional Grade Macros\Parameters\ReturnInteger1> JulianDateOrg.mxe
  15. Hi, Something like this? You need to set up the macro onn a "schedule" (eg every minute or whatever, to run and check; eliminate the box which tells you "SAME" Best, Randall <REM2:Demonstrating run Macro in Variable to set comparison Date stamp string from File details><REM2:FIRST SET UP AN INI FILE WITH FILE NAME><VSETMISC:T4:Installation Path><IFOTH:09:2:%T4%\logchanges.ini><TVAR2:06:01:Select Log File?><MENU2:1:T:06:CenterCenter:SELECT file or make new one?SELECT file or make new one?Select Log File? Make new one><IFVAR2:1:06:7:Select><TVAR2:05:09:SET File which is the log file><ELSE><TVAR2:05:01:%T4%\LogFile.log><TMVAR2:17:04:00:000:000:%T5%F><ENDIF><TMVAR2:18:05:00:000:000:%T4%\logchanges.inianswersLogFileName><TMVAR2:18:04:00:000:000:%T4%\logchanges.inianswerschanges><ENDIF><TVAR2:01:08:%T4%\logchanges.inianswersLogFileName><REM2:Uses variables %T1%-T4%,%T11%, %T10%, %T98%, %N99%, %N1%-%N6%><TVAR2:03:08:%T4%\logchanges.inianswerschanges><VFFILE:0:1:T:2:T:3:T:1:T:4:T:5:T:6:%T1%><TVAR2:31:01:<DT:%T2%\sT:02:2:%N3%/%N2%/%N1%\s%N4%:%N5%:%N6%>><RUNMACVAR:31><REM2:Check if log file (T1) time(T2) different to that in "logchanges.ini" (T3)><IFVAR2:4:02:2:T3><TMVAR2:18:02:00:000:000:%T4%\logchanges.inianswerschanges><TBOX4:T:1:CenterCenter000278000200:000:DIFFERENTT2 is now [%T2%] and different to; last time; T3=[%T3%]><ELSE><TBOX4:T:1:CenterCenter000278000200:000:SAMET2 is SAME [%T2%] as it was; last time; T3=[%T3%]><ENDIF>
  16. Clearly it would be best to use PGmacros if possible; perhaps Kevin has some ideas; using my macros may work but hard to follow, reproduce or fix! Here's the logic, though! Best, Randall cf DatebillGap2.exeEDIT; changed file; see my other posts in this thread DatebillGap3.mxe
  17. Hi Kevin, It would be useful to see some pgmMacro example scripts like this situation, to see how they are used in context? Best, randall
  18. Hi, Good to see you on the forum! Try this link; the file used to make a list of "files which would be deleted;" ; you must change it to activate it and do the deletion (check it is working appropriately first?) If you want exactly 24 hours, use original version here, else if you want "more than one Date" ago; use "yyyyMMMdd" as in the code and attachment below. You can make it recursive through subfolders too, if you change the "Repeat with Folder" line appropriately. Let me know if problems. Best, Randall DeleteByFileDate link DeleteByFileDate.mxe Here's a modification to give you the choice of deleting or not; <REM2:Delete files older than %N99% days from today >><REM2:Demonstrating run Macro in Variable to set comparison Date stamp string from File details><REM2:Uses variables %T1%-T4%,%T11%, %T10%, %T98%, %N99%, %N1%-%N6%><VSETMISC:T4:Installation Path><MENU2:1:T:03:CenterCenter:Delete the Files in a Folder?Just Make a List or Delete the Files?Just Make a List Delete the Files Make List and Delete FilesT><TVAR2:98:10:Set folder for deletion of some files><IVAR2:99:01:1><IVAR2:99:02:FDelete files older than : How many days?FFCenter:Center><TVAR2:11:01:><TVAR2:02:01:yyyyMMdd><TMVAR2:17:11:00:000:000:%T4%\DisplayTemp.txtT><DT:%T2%T:10:3:{P%N99%}{P00000}{P00000}{P00000}><REP3:07:000002:000001:0001:0:01:%T98%><VFFILE:0:1:T:2:T:3:T:1:T:4:T:5:T:6:%T1%><TVAR2:31:01:<DT:%T2%\sT:11:2:%N3%/%N2%/%N1%\s%N4%:%N5%:%N6%>><RUNMACVAR:31><IFVAR2:4:11:3:T10><IFVAR2:1:03:7:TDelete><WFREADY:000000:000002:000000%T1%><DOFILE:08:NN:%T1%>><ENDIF><REM2:Just make a list of files to be deleted for now><IFVAR2:1:03:7:TList><TMVAR2:08:11:01:000:000:><TMVAR2:20:11:00:000:000:%T4%\DisplayTemp.txtT><ENDIF><ENDIF><ENDREP><LAUNCHDEL2:0:01%T4%\DisplayTemp.txt><MRETURN> DeleteByFileDate2.mxe
  19. Here's an example derived from Floyd's type of approach; You would not be doing it in "repeat"; defining each string to find etc as you go? String Splitting <DIS:<TVAR2:98:03:><REM2:Set web source to clipboard, then set variable from clipboard; here just example><TVAR2:98:01:rubbish..."onMouseOut="cs()">Jumbo Jumping <b>Frogs1</b></a>gsdsdghumbusfgs"onMouseOut="cs()">Jumbo Jumping <b>Frogs2</b></a>....."onMouseOut="cs()">Jumbo Jumping <b>Frogs3</b></a>><TVAR2:09:01:"onMouseOut="cs()><IVAR2:03:12:9><NMVAR:08:03:0:0000001:0:0000000><TVAR2:10:01:</a>><TMVAR2:09:97:98:000:000:><TMVAR2:21:97:01:001:000:<b>><TMVAR2:21:97:01:001:000:</b>><REP3:08:000001:000002:0001:0:01:0><IVAR2:01:13:97:%T9%><IFVAR2:2:01:4:0><NMVAR:01:01:1:0000001:1:0000003><TMVAR2:11:97:00:001:N01:><DIS:<TBOX4:T:1:000075000252000899000337:000:T98=T%98% T97=%T97% T2=%T2% T1=%T1%><IVAR2:01:13:97:%T10%><NMVAR:09:01:0:0000001:0:0000000><TMVAR2:10:01:97:001:N01:><NMVAR:01:01:1:0000001:2:0000003><TMVAR2:11:97:00:001:N01:><TMVAR2:07:02:00:000:000:%T1%|><ENDIF><ENDREP><IVAR2:02:12:2><NMVAR:09:02:0:0000001:0:0000000><TMVAR2:10:01:02:001:N02:><TBOX4:T:1:000075000252000899000337:000:T98=%T98% T97=%T97% T2=%T2% T1=%T1%>
  20. What about you time it out? Would this work? - Set your own time for the Timed Display Box Randall (EDIT - Floyd , Is there a better way to do this?) EDIT 2 - Sorry, changed this a number of times; hopefully works now more than once! Getting it to start again if it gives a crash message is a problem though - anyone?
  21. Hi! Sorry I can't help. I doubt if mE3 can do that, as my understanding is that you would be taking back keyboard/ ? mouse controls from it manually into another Window. It requires control of those to do "text type" functions, and you only have one keyboard! Best of luck, Randall
  22. Hi, Afraid not; see other post! Advance weekdays <REM2:First time, use today's day to calculate No of weekdays to advance><IVAR2:01:01:2><DT:dddT:01:3:{F00000}{P00000}{P00000}{P00000}><IFVAR2:1:01:1:TThu><OR><IFVAR2:1:01:1:TFri><NMVAR:01:01:1:0000001:2:0000002><ENDIF><IFVAR2:1:01:1:TSat><NMVAR:01:01:1:0000001:2:0000001><ENDIF><REM2:Do exactly the same as before , but use %N1% to advance date instead of "2"><DT:dddd, d MMMM yyyyT:01:3:{F00000}{P00000}{P00000}{P00000}><DT:dddd, d MMMM yyyyT:02:3:{F0%N1%}{P00000}{P00000}{P00000}><TBOX4:T:1:000198000303000624000151:000:Text with Dates%T1%: Myname: I want to do such and such 2 weekdyas ahead on %T2%> Best, Randall
  23. Hi, I think this is closer to what you want; easier to do your logic with strings and just save the modified string to the clipboard. Your logic reads this way; is it what you wanted? Best, Randall (EDIT -woops, i still had your logic wrong? - changed)
  24. randallc

    Time

    This is the other option; using DateTimeDifferencesInput ; modified for download; Just set time one (%T2%) (sorry) Then time 2(%T1%) , and run the macro (after imported to your library and named. DateTimeDifferencesInput will run standalone and request you to give times 1 and 2 if it finds T1 or T2 do not contain this month''s date in correct format; Best, Randall (It is easier to modify this to "black box-like function" by only setting , say D4 (currently set at end of macro) for the answer from the clipboard (or environment variable "AnswerSeconds") after returning from the macro if you wish) Let me know if problems (Date Differences was not working from site download recently, for unknown reasons; now OK?) EDIT1 - Corrected to give negative result in env variable "CompletedDays" depending on order; re-loaded DateTimeDifferencesInput.mxe
  25. randallc

    Time

    Here are my 2 timer lines; first at time1, 2nd at time2 (run in macro; the macro can be derived from "DateTimeDifferences" macro Randall PS Don't run this or DateDiffences as playable; import them to your library and run and examine) (PS I realise now that my timer macro was more complicated, and did not use "Date Differences" macro; I must update it!) 2. You may need to use "Variable Save and restore before and after each of the liner timers; if you are worried about \\T10,23,31,20,79 N88,89,\\ D1,2,3,4,5,6,26, 79, 86, 88,\\N31,88,79,89 and retrieve %D6% fromthe following; the seconds numbers are stored in the registry Timer_Lines.mxe
×
×
  • Create New...