randallc Posted May 25, 2005 Report Share Posted May 25, 2005 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 Quote Link to comment Share on other sites More sharing options...
cyberchief Posted May 25, 2005 Report Share Posted May 25, 2005 Randall, Your Macro's are Password Protected. I imported them to take a look... and can't access them... nor can I even delete them. what gives? ;-) Quote Link to comment Share on other sites More sharing options...
randallc Posted May 25, 2005 Author Report Share Posted May 25, 2005 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 Quote Link to comment Share on other sites More sharing options...
cyberchief Posted May 25, 2005 Report Share Posted May 25, 2005 It seems like most of the Macro's I imported were password protected... but not all of them. I have downloaded previous Macro's from Randall... and get this... The first time I accessed the Macro, I could look at it... after that... trying to access it... it was password protected. Hmmmm..... Quote Link to comment Share on other sites More sharing options...
randallc Posted May 25, 2005 Author Report Share Posted May 25, 2005 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 Quote Link to comment Share on other sites More sharing options...
cyberchief Posted May 25, 2005 Report Share Posted May 25, 2005 Ok... you included the PGM Macros... but will they run (if I haven't yet purchased the PGM Library)? I am guessing they will... but my whole reason to download them was so I could look at them and use (edit) them to fit my purposes... I have posted on that before (finding a way to find a specific date in between 2 days that doesn't fall within 3 days prior or 5 days after BOTH dates). Oh well... i will see what I can do with these. Thanks. Quote Link to comment Share on other sites More sharing options...
randallc Posted May 25, 2005 Author Report Share Posted May 25, 2005 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 Quote Link to comment Share on other sites More sharing options...
joe Posted May 25, 2005 Report Share Posted May 25, 2005 Yes, unless the PGM Functions Library is installed, the functions wil not run. And yes, you CAN delete password protected macros ... but not manually. They can only be deleted using the Macro Delete command. Quote Link to comment Share on other sites More sharing options...
cyberchief Posted May 26, 2005 Report Share Posted May 26, 2005 Thanks Joe... That is useful information. Actually, being the computer geek I am... I have multiple backup copies that I update every time I edit a Macro (using a macro to copy over the files, of course). I simply deleted the file I imported it into and re-opened a backup version. But that is very useful info. Thanks! Randall, Thanks for the updated file. I will be reviewing for, I am sure, a ton of useful info as well. Quote Link to comment Share on other sites More sharing options...
cyberchief Posted May 26, 2005 Report Share Posted May 26, 2005 Randall, I do have to say that the complexity of your coding is making my head spin :-) It looks as though you did creat a function that I was asking for about a week or two ago... finding a date between 2 dates. But I am having difficulty figuring this out. Running the macro (BasicJulianMYPGM), I select the first date, and then the second date. Sometimes the Macro returns with May 28th... but most of the time Macro Express crashes alltogether. Am I missing something? Quote Link to comment Share on other sites More sharing options...
kevin Posted May 26, 2005 Report Share Posted May 26, 2005 Cyberchief, You said "...most of the time Macro Express crashes alltogether." When this occurs does the ISS Bug Reporter come up? Have you sent a crash report? We would like to find out what is happening when the crash occurs. Quote Link to comment Share on other sites More sharing options...
cyberchief Posted May 26, 2005 Report Share Posted May 26, 2005 Yes.. The bug report does come up. I apologize, I am so used to exiting out of the window (due to those Microsoft error windows much like this one). I will run this a couple more times and send the report. Quote Link to comment Share on other sites More sharing options...
randallc Posted May 26, 2005 Author Report Share Posted May 26, 2005 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?) Quote Link to comment Share on other sites More sharing options...
cyberchief Posted May 26, 2005 Report Share Posted May 26, 2005 Randall... you are BRILLIANT!!!! Quote Link to comment Share on other sites More sharing options...
cyberchief Posted May 27, 2005 Report Share Posted May 27, 2005 Randall, I am looking at your functions and trying to determine where to go from here. I can use your Julian Date function for one of my macros, but am trying to decide on how to incorporate it. The Macro I have has many variables set (some of which are repeated in (Basic Me Lite). Looking at your functions, it appears that you save the variables and then restore them at the end. I have not worked with this before so I just want to clarify one thing before I start... saving and restoring will basically save all the variables I currently have and restore them back after the Basic Me Lite macro runs, correct? Thanks! Quote Link to comment Share on other sites More sharing options...
cyberchief Posted May 27, 2005 Report Share Posted May 27, 2005 Another question... Running your Julian Date program as is works fine now. here is what I am trying to do... rather than a user selected date prompt, I want the macro to pull the two specific dates off of a spreadsheet (column 1, column 2) and input the outcome into column 3. I have edited a copy to do this... but the dates get hosed up. I have figured out that it is a problem with the format of the dates in Excel... I can change the visual format, but it does not change the actual format of the data in excel. I even tried changing the format to custom: 00 00 0000. Doing it this way causes the actual output to be wrong... somewhere in your macro, it interprets the data and changes it. There is some gap in translation. Any ideas on how I can do this? been hammering at it for a while... Quote Link to comment Share on other sites More sharing options...
randallc Posted May 28, 2005 Author Report Share Posted May 28, 2005 Hi, saving and restoring will basically save all the variables I currently have and restore them back after the Basic Me Lite macro runs, correct? Thanks! 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 Quote Link to comment Share on other sites More sharing options...
randallc Posted May 28, 2005 Author Report Share Posted May 28, 2005 Hi, pull the two specific dates off of a spreadsheet (column 1, column 2) and input the outcome into column 3 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; I'm enthusiastic about the "BasicME" approach ("proof of concept"!), even though it is only for fun and not serious application; 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.