Author Topic: JJ_Include and saveAsTemplate  (Read 961 times)

LordAdef

  • Member
  • ****
  • Posts: 588
JJ_Include and saveAsTemplate
« 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

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8445
  • Assembler is fun ;-)
    • MasmBasic
Re: JJ_Include and saveAsTemplate
« Reply #1 on: February 21, 2018, 08:49:33 AM »
Try this...

LordAdef

  • Member
  • ****
  • Posts: 588
Re: JJ_Include and saveAsTemplate
« Reply #2 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

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8445
  • Assembler is fun ;-)
    • MasmBasic
Re: JJ_Include and saveAsTemplate
« Reply #3 on: February 21, 2018, 05:46:47 PM »
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

Right-click on "Here" 8)

Quote
One other thing, The export function is leaving out commented lines

This is by design ;-)

LordAdef

  • Member
  • ****
  • Posts: 588
Re: JJ_Include and saveAsTemplate
« Reply #4 on: February 21, 2018, 06:20:47 PM »
Quote
This is by design ;-)

I love this one! :greensml:

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8445
  • Assembler is fun ;-)
    • MasmBasic
Re: JJ_Include and saveAsTemplate
« Reply #5 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.

LordAdef

  • Member
  • ****
  • Posts: 588
Re: JJ_Include and saveAsTemplate
« Reply #6 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?

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8445
  • Assembler is fun ;-)
    • MasmBasic
Re: JJ_Include and saveAsTemplate
« Reply #7 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...

LordAdef

  • Member
  • ****
  • Posts: 588
Re: JJ_Include and saveAsTemplate
« Reply #8 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.

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8445
  • Assembler is fun ;-)
    • MasmBasic
Re: JJ_Include and saveAsTemplate
« Reply #9 on: February 23, 2018, 05:23:47 PM »
OK, here is your file, all text unhidden:

Code: [Select]
;[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:

LordAdef

  • Member
  • ****
  • Posts: 588
Re: JJ_Include and saveAsTemplate
« Reply #10 on: February 23, 2018, 05:34:18 PM »
Thanks, going to try it now.

LordAdef

  • Member
  • ****
  • Posts: 588
Re: JJ_Include and saveAsTemplate
« Reply #11 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

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8445
  • Assembler is fun ;-)
    • MasmBasic
Re: JJ_Include and saveAsTemplate
« Reply #12 on: February 23, 2018, 06:54:50 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.

LordAdef

  • Member
  • ****
  • Posts: 588
Re: JJ_Include and saveAsTemplate
« Reply #13 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?

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8445
  • Assembler is fun ;-)
    • MasmBasic
Re: JJ_Include and saveAsTemplate
« Reply #14 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:
Code: [Select]
if 0  ; How to proceed:
      - make a plan
      - use it
endif