The MASM Forum

Projects => MasmBasic & the RichMasm IDE => Topic started by: LordAdef on February 21, 2018, 08:26:03 AM

Title: JJ_Include and saveAsTemplate
Post by: LordAdef on February 21, 2018, 08:26:03 AM
Hi Jochen,

I was wondering if there could be a "JJ_Include"  :badgrin:  that we could include asc files for incs and asms. This way people like me could use RM's goodies (colours etc) for the external files too.

This is the sort of magic I'm sure is your thing!

I'm really used to my colour schemes and external files look awful..



saveAsTemplate:  Is there a way to save a asc file as template for new ones? As of now, I have preferencial colours saved in the colour picker, bk colour and everything as I like. I am currently saving my main file as template and clearing the content. But having templates would be a cheery on top of a cake. Not too important but nice
Title: Re: JJ_Include and saveAsTemplate
Post by: jj2007 on February 21, 2018, 08:49:33 AM
Try this...
Title: Re: JJ_Include and saveAsTemplate
Post by: LordAdef on February 21, 2018, 09:25:10 AM
So,

I create an IncAsc where I do my code. Then I export it in order to build. It makes sense. That´s what you mean, right?

I guess I could simply copy the "Here" thing into my files. But I need it to point it to my project folder, and export it to either .inc  or .asm

One other thing, The export function is leaving out commented lines
Title: Re: JJ_Include and saveAsTemplate
Post by: jj2007 on February 21, 2018, 05:46:47 PM
Quote from: LordAdef on February 21, 2018, 09:25:10 AMI guess I could simply copy the "Here" thing into my files. But I need it to point it to my project folder, and export it to either .inc  or .asm

Right-click on "Here" 8)

QuoteOne other thing, The export function is leaving out commented lines

This is by design ;-)
Title: Re: JJ_Include and saveAsTemplate
Post by: LordAdef on February 21, 2018, 06:20:47 PM
QuoteThis is by design ;-)

I love this one! :greensml:
Title: Re: JJ_Include and saveAsTemplate
Post by: jj2007 on February 21, 2018, 08:11:53 PM
No, really, it's by design. It allows me to keep the size of the MB package below the 512k limit, and that really impacts on my coding style: I have become much more generous with comments; and if I want a comment to be public, the if 0 ... comments ... endif still works.

Regarding templates:
- Create a file (File/New text file)
- insert links:
   - copy a path to the template file
   - type MyColours
   - select it
   - hit Ctrl K
   - add n/ before, e.g. /n\Masm32\MasmBasic\AscUser\MyColours.asc
- Save As
- hold Shift when clicking OK
- if you see the "make sticky" dialog, click Yes

The sticky makes sure the file never disappears from your recent files list; the \n makes sure you cannot save the template file, i.e. when trying to save it, you will see the Save As dialog.
Title: Re: JJ_Include and saveAsTemplate
Post by: LordAdef on February 23, 2018, 10:57:10 AM
Hi,

I still didn´t manage to me it work:

in the asc file, I put this:

Quote;ExportInc


;;;In the link above : exp=\masm32\AFprojs\ii.inc ????
;$uc
echo *** QM included         ; DO you need this?


mox eax, 12
mox ebx, 22

;$RL

I must do this for asc files and inc files. Can you do a version for dummies?
Title: Re: JJ_Include and saveAsTemplate
Post by: jj2007 on February 23, 2018, 05:10:11 PM
; click here to export my stuff ;$uc

The here link has this format:

#unique_token=\masm32\myfolder\somefile.inc
  ... code ...
;$rl ------------- end of unique_token ------------------------

Can you post your asc file, so that I can have a look? And what do you mean with "I have to do it for asc files"? You cannot export rtf code this way (why should you?), only plain text...
Title: Re: JJ_Include and saveAsTemplate
Post by: LordAdef on February 23, 2018, 05:15:16 PM
Quote"I have to do it for asc files"?
I meant to say *.asm files. It was a typo.

This is a template for what I want. It´s an empty file.
Title: Re: JJ_Include and saveAsTemplate
Post by: jj2007 on February 23, 2018, 05:23:47 PM
OK, here is your file, all text unhidden:

;[url=exp=\masm32\AFprojs\ii.inc]ExportInc[/url]

;;;In the link above : exp=\masm32\AFprojs\ii.inc ????
;$uc
echo *** QM included ; DO you need this?


mox eax, 12
mox ebx, 22

;$RL


Three minor problems:
- # missing: #exp=
- token exp is in " link above : exp=...", so it would stop there; remove that line
- no token exp after that - how should RM know where to stop?

If you replace exp with e.g. exp_ii, it will become clearer. The echo is not needed, it's just for testing.
HTH :icon14:
Title: Re: JJ_Include and saveAsTemplate
Post by: LordAdef on February 23, 2018, 05:34:18 PM
Thanks, going to try it now.
Title: Re: JJ_Include and saveAsTemplate
Post by: LordAdef on February 23, 2018, 05:45:20 PM
The file has this now:

Quote;ExportInc

;$uc


mox eax, 12
mox ebx, 22

;$RL

ExportInc has this: #exp_ii.inc=\masm32\AFprojs\ii.inc

But not working: "Not found after link" message
Title: Re: JJ_Include and saveAsTemplate
Post by: jj2007 on February 23, 2018, 06:54:50 PM
Quote from: LordAdef on February 23, 2018, 05:45:20 PM
The file has this now:

Quote;ExportInc

;$uc


mox eax, 12
mox ebx, 22

;$RL

ExportInc has this: #exp_ii.inc=\masm32\AFprojs\ii.inc

But not working: "Not found after link" message

End token missing. Try this:

; *** the end: exp_ii.inc *** $RL

The editor needs to know where your export stops, so there must be an identical token at the end. Btw this allows means that you can have multiple exports in a single *.asc file. You can even append them all to your main RAID source, after the end start or EndOfCode. This way you are working with a single source, and can search and edit directly if needed.
Title: Re: JJ_Include and saveAsTemplate
Post by: LordAdef on February 24, 2018, 03:05:26 PM
It´s working now. The only problem is my code is commented

";----this is a comment----"

and this process doesn´t seem to work with those, except from comment #-------#, which I´m not using. I like the ";----dsss-"  thing. Not possible?
Title: Re: JJ_Include and saveAsTemplate
Post by: jj2007 on February 24, 2018, 08:44:53 PM
Can you post a sample with tokens and comments, please? Maybe I can do something.

My own multi-line comments are nowadays all like this:
if 0  ; How to proceed:
      - make a plan
      - use it
endif
Title: Re: JJ_Include and saveAsTemplate
Post by: LordAdef on February 25, 2018, 08:18:03 AM
I use conventional semi-colon comments. One file attached.
Title: Re: JJ_Include and saveAsTemplate
Post by: jj2007 on February 25, 2018, 04:41:56 PM
OK, there was a problem with long comments at the start of the file. Try the attached beta.
- Ctrl click skips the MsgBox and exports with comments stripped.
- normal click shows a MsgBox; yes exports content without, no exports with comments.
Title: Re: JJ_Include and saveAsTemplate
Post by: LordAdef on February 26, 2018, 08:26:02 AM
Cheers JJ. Now it´s all ok. The good thing is it allowed you to get that bug.
Title: Re: JJ_Include and saveAsTemplate
Post by: jj2007 on February 26, 2018, 08:29:33 AM
Quote from: LordAdef on February 26, 2018, 08:26:02 AM
Cheers JJ. Now it´s all ok. The good thing is it allowed you to get that bug.

Yes indeed, thanks :biggrin: