News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

the INDENT function in QEDITOR

Started by supercoollee, May 06, 2010, 05:04:17 AM

Previous topic - Next topic

jj2007

Quote from: sinsi on May 08, 2010, 08:58:23 AM
A feature I would like to see is one that's in the FASM editor - vertical selection with cut/copy/paste.

Sinsii,
Just curious: Can you give an example where that would be useful?

sinsi

jj, I use the FASM editor as a general text editor when I want a quick'n'dirty way of getting rid of the first 4 characters of a text file for example.
Just select them vertically and hit delete.

edit: getting rid of the first 4 characters of each line in a text file
Light travels faster than sound, that's why some people seem bright until you hear them.

dedndave

yes - that is a feature i miss from PC-Write - it was called "Block Edit"

one example of where you might use it....
you make a text file list of files using DIR
they are listed, filename first, then size
with PC-Write, you could mark the filename column - copy - cut
all that's left are the sizes
then, paste the names on the right
you have swapped column order so that sizes are listed first, then names

now, i know DIR has been updated with options to do this, but it is just an example

btw - i am not bashing QE - lol
i just mentioned one thing that i noticed, is all - it was only a suggestion   :8)

jj2007

Quote from: sinsi on May 08, 2010, 12:51:17 PM
edit: getting rid of the first 4 characters of each line in a text file

Quote from: dedndave on May 08, 2010, 01:33:51 PM
you make a text file list of files using DIR
they are listed, filename first, then size
with PC-Write, you could mark the filename column - copy - cut
all that's left are the sizes
then, paste the names on the right
you have swapped column order so that sizes are listed first, then names

Ts ts ts... why overload a poor editor with functions that you can do with a few lines of assembler?

include \masm32\MasmBasic\MasmBasic.inc
Init
Recall "\Masm32\include\Windows.inc", L$()
For_ n=0 To eax-1
Let L$(n)=Mid$(L$(n), 5)
Next
Store "WindowsMinus4.inc", L$()

Open "O", #1, "tmp.bat"
Print #1, Chr$("dir *.asm ", 62, "1.txt"), CrLf$
Close
Launch "tmp.bat", SW_MINIMIZE, 5000
Recall "1.txt", L$()
For_ n=5 To eax-3
Let ecx=L$(n)+Space$(40)
Let L$(n)=Mid$(ecx, 37, 40)+Left$(ecx, 35)
Next
Store "1.txt", L$()
Launch "\masm32\qeditor.exe 1.txt"
Exit
end start

:lol

hutch--

 :bg

Now for those folks who need to strip left side leading spaces from their text, try the block select on the whole file loaded into QE then use the "Less Indent" button OR "The micro-indent" with the arrow buttons and adjust the side spacing to your required layout.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

oex

Quote from: sinsi on May 08, 2010, 12:51:17 PM
jj, I use the FASM editor as a general text editor when I want a quick'n'dirty way of getting rid of the first 4 characters of a text file for example.
Just select them vertically and hit delete.

edit: getting rid of the first 4 characters of each line in a text file

I like that idea

;(code)
;comments
;stripped
;in
;one
;go
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

jj2007

Quote from: oex on May 08, 2010, 11:50:18 PM
I like that idea

;(code)
;comments
;stripped
;in
;one
;go

That sounds a bit too simple - what if you have a comment every second line...? In RichMasm, you can select a block and then comment/uncomment the whole block by hitting the F4 key; but that function requires a check for every line if it starts with a semicolon or not. Otherwise you end up with "ov eax, 123", double semicolons or similar effects... ::)
QEditor's Tools/Block Asm comments works pretty well in this respect.

oex

I rarely get outside of notepad and my own apps :lol I was just in the process of editing my code and saw a use.... I long ago realised that learning all the editors tricks and finding the right editor and changing the settings then loosing the settings  including the license serial every hard drive crash was actually generally slower than manually coding everything up as I like it.... The tab issue was curious to me because it's a very old style of tabbing (in my computing lifetime) and I hadnt really understood whether it was feature based and with reason or just 'feature poor'.... In other words I was just checking if you old timers were using a trick I did not know.... It is surprising the tricks you can find in even feature poor functionality that was obsolete before some of us kiddies got to the table

I like the further twist you added and have seen it in apps like visual studio.... It was useful, especially the ability to click a few pixels at the beginning of a line to select the line and multi-comment ie ;; to have multiple levels of debugging (I think this is likely already available in a basic commenting function).... I will write my own editor eventually but I code in many languages so this could be a little while yet.... I think I've covered most of the conceptual it's just a question of having the time to take on such a monumental task.... I wrote one for php once in html, with js being so mind numbingly tardish that is certainly a monumental task :lol

Windows is designed as a user operating system not a programmers interface imho.... This is changing and they have added more programming features over the years but everytime they make a change you need functionality/information to change/update your code and they can be sketchy with the details.... You have to follow their controls and proceedures, it's like painting by numbers.... They do however have a lot of useful functionality even in something as simple as notepad which is hard to replace in full :lol

Though I might add notepad has some crappy dealing with chr$(10)
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

supercoollee

i wish QEDITOR has a "recent files " menu  ::)

hutch--

Think about it and you will know why it does not have that written in it. It is a multiple instance editor so the MRU list would be out of date each time you opened a new file while other instances are running.

The solution is to write your own and you will have none of the problems you mentioned.  :bg
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

supercoollee

i found that i can modify the menu. i want to put some frequently used files in the menu, such as "windows.inc".  i wrote:

read windows.inc,MASM32\include\windows.inc

in [&Tools] paragraph.

but when i click the menu, the file doesn't come up, why?

supercoollee

haha, i found the way  :green2

Read windows.inc,qeditor.exe "d:\masm32\include\windows.inc"

hutch--

 :bg

You have just learnt one of the magic secrets of editor design, "extendability". QE can do this type of operation on any executable file on your machine.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

jj2007

Quote from: hutch-- on May 10, 2010, 01:01:59 AM
Think about it and you will know why it does not have that written in it. It is a multiple instance editor so the MRU list would be out of date each time you opened a new file while other instances are running.
You could update the MRU list to the ini file, and create the menu on the fly (that's how I do it).

Quote
The solution is to write your own and you will have none of the problems you mentioned.  :bg
Yep :toothy

hutch--

he problem is with an MRU in a multi-instance editor is the sheer clutter that it would generate when you keep multiple instances open which is part of the design of QE. Unless you had an MRU list dozens deep you would generally not find the last source file you were after as it would end up too far down the list to be useful. MRU lists are for single instance applications only with MDI or tabs, it becomes unworkable with 5 or 6 instances running and much worse with more.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php