|
Post by cyberchipz on Feb 13, 2020 16:24:09 GMT
So, I've noticed a number of particular aspects of coding with MMM. And, if at any time you can just point me to a section in documentation that I've yet to read, please.. that's just fine, I can expand if I don't understand it after reading it. Hopefully this will save you some time.
So MMM uses both the vertical line "|" and "::" a lot... if they have names, I'd like to know them. Anyway, I've noticed the bar | seems to serve as a separator between commands, variables, and other required parameters when using a key word. It seems that the number and order of those are very specific; but, I was wondering how you would describe the function of the "|" bar... and the same for the "::" which seems to be some kind of math or assignment function operator. So a few words about them would be helpful.
KEY WORDS: I was thinking an alphabetical list of KEY WORDS would be something useful... and while and when I have time, I would work on that. But, one question right now... I've noticed that strings, when used as a parameter doesn't require any quotations... lol, learned that when %string% | IS | "YES" kept evaluating to false when trying to use "YES/NO" prompts. But, can I use a single ":" colon in the string without any problems... IOW is ":' a colon a KEY WORD or symbol?
Along those same lines... Are any particular symbols forbidden in a STRING? It can be difficult to troubleshoot enough... and I'm not familiar with DEBUG yet... that's another task I will be doing, but inserting forbidden characters into the wrong place can be quite troublesome... and I'm just trying to save myself a few hair pulling moments when things don't work. I've started using the event log a bit, and it can be somewhat helpful, moreso with time... just knowing something is wrong is helpful... That dreaded RED number indicator when I run the code! lol Between that, and my minor dyslexia... it's a wonder that I learned to code at all.
BTW, is there any way to change background and font color in MMM at all? As I mentioned before, my aging eyes are having a really hard time with the bright screen. Like I said before... I have an app that inverts colors on the Browser when I need it, so this thread and post is black background with white for me... very soothing. But, I can't control apps that well. NOTEPAD is just as bad... and, I lost some faith with Notepad++; but that was when Sourceforge went though some (cough) buggy days with some unwanted code riders imbedded in the install packages! 8-o
***So, to summarize: "|" bar, "::" double colons, KEYWORDS, Forbidden Symbols in Strings, and Background and Font Color in MMM?
Thanks... I realize what a labor of love this program is... but.. I think it's great... I believe I realize you're also trying to keep it MINI, and so probably fighting bloating... and so I realize that's a primary intention... and will adjust my expectations accordingly... Plus your time... as a developer I appreciate what a project like this entails... fixes, changes, etc... can really eat up the time. I really do appreciate the time you give! I can relate! Thank you so much!
Chip
|
|
|
Post by Steve on Feb 14, 2020 5:15:12 GMT
Chip thanks again for another great post. I'll answer off as best I can. 1. "So MMM uses both the vertical line "|" and "::" a lot... if they have names, I'd like to know them. Anyway, I've noticed the bar | seems to serve as a separator between commands, variables, and other required parameters when using a key word. It seems that the number and order of those are very specific; but, I was wondering how you would describe the function of the "|" bar... and the same for the "::" which seems to be some kind of math or assignment function operator. So a few words about them would be helpful."The vertical line " | " or 'pipe' is the default delimiter value. Notice that this is "[space]|[space]". The delimiter values separate the key macro parts. For example: 20 | 1240 | 191 | 15 | Mouse Movement 21 | RUN ACTION | DELETE FILE | P:\folder1\folder2\file.jpgLine 20 the delimiter values separates [LINE NUMBER] | [MOUSE X] | [MOUSE Y] | [ACTION] Line 21 the delimiter values separates [LINE NUMBER] | [ACTION | [ACTION PARAMETER1] | [ACTION PARAMETER2] The delimiter is essential as it, starting from the left, instructs the macro machine (what i call the code that processes the macro lines) how to process the macro. MMM is quite linear. Each line is read one at a time, left to right, top to bottom. This is why line numbers and 'relisting' is important to control the macro flow (you've probably figured this out). Delimiter values can be changed in the settings "::" is used to separate actions parameters that have multiple sections. Conditioner this line: 3 | IF | STRING VARIABLE | %LINE% | CONTAINS | %date% - Out | OUTPUT TO FILE | E:\out.txt::APPEND::%file%
Here we have the delimiters ' | ' breaking up the conditions line into two sections; an IF condition and an OUTPUT TO FILE action. The action parameter is further broken up by the '::' separator to split three values [param1]::[param2]::[param3]. When this line is fed into the macro machine and if the IF condition where to evaluate to TRUE the OUTPUT TO FILE action runs. OUTPUT TO FILE needs parameter values. The macro machine is expecting the last delimiter after the action to have these params separated by '::'
2. "KEY WORDS: I was thinking an alphabetical list of KEY WORDS would be something useful... and while and when I have time, I would work on that. But, one question right now... I've noticed that strings, when used as a parameter doesn't require any quotations... lol, learned that when %string% | IS | "YES" kept evaluating to false when trying to use "YES/NO" prompts. But, can I use a single ":" colon in the string without any problems... IOW is ":' a colon a KEY WORD or symbol?"The configured delimiter value is a key word. Trying to declare say ' | ' as a STRING will cause MMM to split the line at the delim. 1 | RUN ACTION | DEFINE STRING VARIABLE | %STRING%::delim is ' | ' ok? 2 | RUN ACTION | MESSAGE PROMPT | %STRING%::::0Playback error: 20 | RUN ACTION | DEFINE STRING VARIABLE | %STRING%::delim is ' | ' ok? - Condition execution error [Unexpected Internal Error]: Index was outside the bounds of the array.Notice the exception. The macro machine knows that DEFINE STRING VARIABLE is a standard fixed length when reading from left to right. Adding that extra delim causes the array indexes to be out. Other than that '::' within parameter values could do the same, however most of the time (im almost 100% confident) MMM will catch that and either ignore it or throw a warning in the event log detailing bad formatting.
3. "BTW, is there any way to change background and font color in MMM at all? As I mentioned before, my aging eyes are having a really hard time with the bright screen. Like I said before... I have an app that inverts colors on the Browser when I need it, so this thread and post is black background with white for me... very soothing. But, I can't control apps that well. NOTEPAD is just as bad... and, I lost some faith with Notepad++; but that was when Sourceforge went though some (cough) buggy days with some unwanted code riders imbedded in the install packages! 8-o" Not the background unfortunately, but the text size and color can be.
4. "Thanks... I realize what a labor of love this program is... but.. I think it's great... I believe I realize you're also trying to keep it MINI, and so probably fighting bloating... and so I realize that's a primary intention... and will adjust my expectations accordingly... Plus your time... as a developer I appreciate what a project like this entails... fixes, changes, etc... can really eat up the time. I really do appreciate the time you give! I can relate! Thank you so much!"
Thank you Chip. I am not a developer by trade and programing is something I enjoy that compliments my main discipline....i don't even work on Windows OS anymore lol The little project has come a long way from what it started out to be. I think it's got a couple of years left in it.
Thanks again Chip!
|
|
|
Post by cyberchipz on Feb 15, 2020 9:38:59 GMT
edited: Let me add, changing font and color helps a lot! I liked your choices, but without a scroll... 18 is a bit too big. 14 willdo... Thanks for the suggestion.
So, I hear you basically saying that the pipe, | and :: are the only two keywords... MMM primarily looks only for those two things, except for what follows them, which are the parsed keywords. I'm presuming that anything after the pipe in a comment is ignored, IOW * | is a comment and | and :: would be ignored.
As far as a colon in a string declaration, yep... it works. I love that you don't require quotes for a string. First time I ever saw it. I remember when... (ok.. no more wall of text tonight) lol
Well, maybe a little.. On a personal note... I'm in a battle with prostate cancer, so if I disappear... well... but, anyway...
I hope to stick around... I would love to work on a MMM dictionary... grammar and syntax, purely voluntary of course (and not sure it's needed now as much). And, when I asked, I now realize that all the keywords needed for that are built into the *Add Condition* statement builder. In fact, it's a dictionary in itself, as well as a syntax teaching tool. What a marvelous thing! Plus it really reduces typos.. It's just soooo bright! in more ways than one. ;-) Thank goodness this board works well with a Chrome app "High Contrast" (sigh) My eyes give out on me before my enthusiasm. But even MS hasn't made a dark theme to write on with Word. Yes, Dark Theme, but the page one writes on is still white. I've tried to make it black; but it prints that way too! (MMM run REMOVE all font code White on Black) I just realized that's possible!, ironically the parts of the page that have no letters are still white. Before we got Trump for a president, the computer world was more focused on providing computer aids for the Handicapped. (oops, no politics... sorry)
|
|
|
Post by Steve on Feb 17, 2020 9:16:08 GMT
Thanks Chip! I will have a look into the back ground color. Shouldn't be too hard to get added.
I hope everything goes well with you mate. Sorry to hear about that...I hope you don't disappear, I appreciate all the banter on the forum!
Cheers again Chip!
|
|
|
Post by cyberchipz on Feb 25, 2020 23:28:01 GMT
You must be swamped... haven't seen you on for days.. I still seem to be able to workaround most issues... Definitely I must take care not to leave out or misspell a LineLabel, naturally, that gives a very rude end of macro ... non, event. It would be nice to have the system throw a simple error, on that. Line lable LABEL not found at (line of code using label) when it comes to that
|
|
|
Post by Steve on Feb 26, 2020 5:48:13 GMT
Yep its been a crazy couple of weeks.
Can you expand on this? So your saying rather than MMM not finding the line label and going to the end of the macro it should perhaps return FALSE and just continue?
|
|
|
Post by cyberchipz on Feb 27, 2020 5:55:22 GMT
That might be even more confusing... No, actually I like that it stops running the macro; but it isn't throwing an error, or giving any indication that it couldn't find the line label, it just goes to the end of the macro, but the user isn't sure what happened or where in the code it happened. Since in MMM, you can give out an error message, I think it would be nice if, when it doesn't find a line label, it would, yes, go to end of macro and stop running, OR... stop running at the line that requested the goto and had the line label, or, AND post a (red at the bottom of the macro) Error message saying something line: Line label LABEL not found at (line of code using label) (OR whatever you choose to tell us) indicating the last line that it was executing, when it was trying to MACRO GOTO LINE | NonExistentLabel
Is that a bit clearer... as it is now, it just kinda leaves you hanging wondering... uh? what happened? I knew *about* when it stopped doing what I wanted, so I remembered what you told me about how it looks for line labels, and *eventually* noticed the typo in the * | LineLable(sic).
Of course... my problem is I'm Monkey see, Monkey do kinda guy when it comes to coding. So, when I saw that you, or zeak, were using under_scores in the line labels Line_Label and I normally use LineLabel, for example, an old habit, I started underscoring some, and using my old habits other times... and that is where I messed up. I underscored one, and didn't the other. Which when troubleshooting, can be a more difficult, because one is looking for a logical error, and with or without an underscore, it reads the same in my mind. So, just a teensy bit of a head scratcher for a few moments...
Did it throw an error, and I missed it? Because when I went to look at the code, if the Macro doesn't END, and is just STOPPED, I clear... But, if my memory serves me, I think I can only clear an Error by viewing it... and I don't recall one when it couldn't find the label.
|
|
|
Post by Steve on Feb 27, 2020 6:16:36 GMT
Yep makes sense thanks Chip. I'll look to adding that in the next update
|
|
|
Post by cyberchipz on Feb 27, 2020 7:06:51 GMT
Thanks... lol... sorry to be making more work... wish I could write the code for ya! ;-)
|
|
|
Post by Steve on Mar 1, 2020 3:56:34 GMT
That might be even more confusing... No, actually I like that it stops running the macro; but it isn't throwing an error, or giving any indication that it couldn't find the line label, it just goes to the end of the macro, but the user isn't sure what happened or where in the code it happened. Since in MMM, you can give out an error message, I think it would be nice if, when it doesn't find a line label, it would, yes, go to end of macro and stop running, OR... stop running at the line that requested the goto and had the line label, or, AND post a (red at the bottom of the macro) Error message saying something line: Line label LABEL not found at (line of code using label) (OR whatever you choose to tell us) indicating the last line that it was executing, when it was trying to MACRO GOTO LINE | NonExistentLabel Added it today. It will make it's way to the event log as a warning - not an error. It can be deliberate for someone to intentionally not goto a line label/number, so its a WARNING not ERROR. It will make it's way to the next update. Thanks for this one.
|
|
|
Post by cyberchipz on Mar 9, 2020 12:57:48 GMT
Yes, I see... not wanting to go to a line label that does not exist, instead goes to end of Macro... could be useful... never thought of that. lol
|
|