September 26, 2016 at 6:49 am #22119
How to Scan the Source Code with the Help of MACRO in Multiedit 8.0G Gold.
Could you help me with the small Macro which will scan the Source Code for a Specific Character.
For Ex :-
IF A = B
Here we just need to search whether END-IF is used or not. If there is any Sample Macro which we can Run in MULTIEDIT 8.0G Gold to scan the Source Code. It would be very Useful.
Thanks in AdvanceSeptember 26, 2016 at 4:16 pm #22121
This would not be a simple macro as it would have to deal with nested ifs. On the surface it seems if you search for an if and then search line by line for either an end if or another if, if you found an if before an end if you have a mising end if. But nested if statements prevent that assumption. You would need a loop doing the searching and if an if is found before an end if, you increment a counter. When you find an end if you decrement the counter. If at the end of the code you have a positive value on the counter then an end if is missing.
ME 8 is a very old version so I don’t know if it has the Tools-Match language structure function. That would allow you to place your cursor on the if statement, invoke that function and it would find the matching end if, or visa versa.
If ME 8 has that function you can go to the extension setup and look for the name of the match language structure CMAC macro. That macros’s source might be a good jump off point for what you want to do.
ClaySeptember 28, 2016 at 7:37 am #22123
Thank You So Much for the Explanation.
Now I am getting a new Issue,
I have written a Small Macro of HELLO WORLD and saved it as .S
I am compiling the macro with COMPILE CMACWIN Macro in Multiedit 2008.
After Compiling I am getting NO ERRORS. MACRO FILE = ” LOCATION ”
But there is No File ( .MAC ) at that location.
Could you please help me at this.
Thanks in Advance for your Swift Response.September 28, 2016 at 12:32 pm #22127
Above Issue has been Resolved Successfully.
ThanksSeptember 28, 2016 at 4:05 pm #22129
If you go to this post and scroll down there are links to many tutorials on using the CMac language.
ClaySeptember 29, 2016 at 8:31 am #22131
Thank You So Much for your help.
I have written a Small Macro and its running also.
The only Issue right now I am Facing is I cannot able to find the .MAC file.
I checked in the below mentioned path :-
C:\Users\AppData\Roaming\Multi Edit Software\Multi-Edit\11\Config.04\MAC
But Nothing Found, I checked the Hidden files also but Nothing present there also.
Could you please help me on this.
I am Using Multi Edit 2008.
Thanks in Advance 🙂September 29, 2016 at 4:53 pm #22132
Everything is working fine but now I am facing issue while writing a small macro to open a file and scan for a Specific field and display in the tool pane or create a new file.
Could you help me with the Small Macro or Reference to Similar existing Macro.
Thanks in Advance 🙂September 29, 2016 at 6:11 pm #22133
Not sure about writing to the tool pane but if you want a macro to tell you something you can use Make _message. See how here
If you want to write something to a new file you should use LDfiles to open the file. The function is found in MESYS.s. Open the file from the install src directory then search for ldfiles. 2nd search will take you to the function and its inputs are described in the comments at the top of the function. It is the go to macro for loading existing or new files. You can search the Help-cmac reference for the phrase File Access Function List to see the other file manipulation functions.
To get a named mac file you need to start your .s file with
Also to use functions from other system mac files you need an include of the header file like this:
Also when switching between open files you should use their Window id, You can find out about these functions by searching the cmac reference for: Window Function List
Also you may want to look at Help-Cmac user guide. Especially Chap 12.
I realized that the link I gave you for the tutorials, in that post the links to the actual tutorials are broken. Instead you can get to them by searching the forum for the title of the one you want, then search the search results page with your browser search for the title until it is found in a title.
Hope this helps,
- You must be logged in to reply to this topic.