Is there a tool that fills the tabs of a source file with spaces ?
So if I post a source it's better readable if someone uses another tab space ?
I just do a Find/Replace in Word. ^t is the escape for a tab.
Instead of launching MS Word, try this - I hope it's self-explanatory ;-)
include \masm32\MasmBasic\MasmBasic.inc ; download (http://masm32.com/board/index.php?topic=94.0)
Init
Let esi=Clip$()
SetClip$ Cat$(Replace$(esi, Tb$, " "))
Exit
end start
Thanks.
I never used MasmBasic.....
Don't know what to do with Tabs2Spaces.exe ?
When I execute the file nothing happens.
Quote from: Siekmanski on July 17, 2012, 08:21:38 AM
When I execute the file nothing happens.
the current clipboard content is manipulated
Swiss File Knife is a command-line tool that does all kinds of stuff
http://sourceforge.net/projects/swissfileknife/ (http://sourceforge.net/projects/swissfileknife/)
it's easy to write batch files that use it
I'll have a look at Swiss File Knife.
Quote from: qWord on July 17, 2012, 08:27:49 AM
the current clipboard content is manipulated
Which is usually an unfriendly act, but when posting code to the Forum, you need to use it anyway ;-)
Here is a special variant for the Masm32 Forum:
include \masm32\MasmBasic\MasmBasic.inc ; download (http://masm32.com/board/index.php?topic=94.0)
Init
Let esi=Clip$() ; get clipboard text
SetClip$ Cat$(Replace$(esi, Tb$, " ")) ; set modified text with 4 spaces per tab
.if WinByTitle("Post reply -") ; check if the reply window is already open
invoke SetForegroundWindow, eax ; if yes, go there
.endif
Exit
end start
Of course, you need to launch the proggie. For use with QEditor, menus.ini needs a line like
Quote[&Tools]
...
Tabs to Spaces,{e}\masm32\Tabs2Spaces.exe
Just write the algo, its no big deal to do. You need to know what spacing matches your tab settings but its just arithmetic and spaces as padding. QE does it automatically as you type.
QuoteJust write the algo, its no big deal to do.
You are right hutch, I'll write it myself. ( I was just in a lazy mood ) :biggrin:
Quote from: hutch-- on July 18, 2012, 08:35:08 AM
Just write the algo, its no big deal to do. You need to know what spacing matches your tab settings but its just arithmetic and spaces as padding.
Thank you, it's not just a find-and-replace, as a TAB attempts to push the column to 8, 4, or 2 characters, or whatever the alignment preference is.
They are pretty much noddy programs, I scratched up some DETABx and RETABx applications in C (I know) to transition between soft and hard tabs.