News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

replies to 'DrawBitmap procedure' and other meanderings

Started by NoCforMe, August 30, 2022, 06:30:24 AM

Previous topic - Next topic

NoCforMe

Well, using those block-structured constructs (.if, .while, switch/case) pretty much implies indented code, that is if you want it to be easily readable and understandable. I totally get why C and other languages are indented that way. Just not the way I like to format my code.
Assembly language programming should be fun. That's why I do it.

zedd151

That's fine too. Coding is a tad faster without it I'd imagine.
I'm sort of in the same boat as dedndave, in that I generally reformat others' code to what I'm used to. I once had a qeditor plugin that could do that, but it failed in nested if blocks. So a rewrite might be in the works at some point. It's nowhere near ready for the masses. lol


One thing that bugs me though... Those extra long lines of code. "qeditor", which I use doesn't have a word wrap option. That makes viewing 'wide' lines of code difficult. I feel as if the line of code would spill out into my desk from the right side of my monitor and drop all the ascii characters there.  :joking:  But that's another issue for another day.


I wonder if I could make a qeditor plugin for adding word wrap... thinking... (insert progress loop here)

NoCforMe

I'll tell you what would make a really kewl editor plugin: the ability to select columns of text instead of the normal row-oriented block selection.

My all-time favorite editor, Multi-Edit, which unfortunately no longer runs on Windoze (at least my ancient copy) had this capability. Comes in really handy when trying to extract stuff from tables, or just for switching around large blocks of text. (It also had a magnificent macro language that you could extend with custom code to make the program do just about anything you wanted.)

I'm actually working on a custom edit control which can do this, but it's a pretty ambitious undertaking ... maybe someday?
Assembly language programming should be fun. That's why I do it.

zedd151

Quote from: NoCforMe on September 01, 2022, 04:54:40 AM
maybe someday?
Would have to be in the not near future, as I have a full plate so to speak.

What format would this table be in? (comma, semicolon, space or other?) seperated values ?)

Another thing I hate are 'hard' tabs, (09h) qeditor has indent functions that don't first convert the tabs to spaces (yes qeditor issue) I do have a plugin (untab) for that purpose. And needless CAPITALIZATION where lowercase is still valid in masm (We're no longer in the MSDOS/Win3.1 era fortunately). I have (uncap) for that, which reminds me I found more items that could be converted to lowercase.


Anyway if/when I decide to go back into creating plugins (I'll look into your suggestion at that time), I'll create a topic for it and post them.
edited to add:
Damn, I just noticed I have 995 posts already. I wanted to save the 1000th post for my birthday Friday. (sargent swordfish gets another stripe  :toothy: )

jj2007

In RichMasm, you can select a block of text and then, using Tab and Shift Tab, shift the whole block right or left. That doesn't allow to extract columns from tables, but actually I would rarely see a need for that.

What I would desperately miss in any editor are things like
- a listbox with the matches of a find operation (->img)
- persistent bookmarks
- Alt left arrow/right arrow to jump between the last places visited
- individual colouring, see below

As you can see, I also use push push call occasionally - but I keep track with white background :cool:

zedd151

Quote from: jj2007 on September 01, 2022, 05:30:18 AM
In RichMasm, you can select a block of text and then, using Tab and Shift Tab, shift the whole block right or left.
Whether it has 'hard tabs' or simple spaces? If so, kewl. But I still like qeditor.  :greensml:

hutch--

The factor that sticks in my head for using pseudo high level constructions is decluttering a code source, especially if what you are writing is very complex. A UI application in Windows has a substantial amount of complex code and when you have to process at least dozens of messages that are sub-split like nested WM_COMMAND message, using PUSH / CALL notation becomes a nightmare.

I have in the past prototyped using a lookup table for branching through message processing and a WndProc() is very clear when done that way but they are messy and complex to set up where a switch block is clean, tidy and easy enough to read if its formatted properly.

NoCforMe

Getting back to the thing of selecting columns, no, I'm not talking about actual tables, like HTML ones: I just mean selecting a column of text in a text file. No delimiters, just text. It could be a table, or it could just be a block of text where you need to rearrange stuff, like, say, if you're converting C #defines to ASM EQUates. Stuff like that. Multi-Edit did it effortlessly. (The last time I needed something like that is when I downloaded some data from the US Navy, day-length data, and needed to turn their 2-D table into a 1-D list. Column-selection would have made it a piece of cake.

Multi-Edit also has really nice case-changing ops: set upper- or lowercase, capitalize first letter, etc. I miss it.
Assembly language programming should be fun. That's why I do it.

zedd151

Okay, I think I know what you mean now. Similarly the way you can select text in a command window in quick edit mode. I think the font has to be a mono space font for that to work. I don't know exactly how to code for that, but it uses some gdi functions to select a rectangle around the text and some other functions to determine font width height, etc.


When you said the word 'table' I was thinking a data structure type table. You want to 'rubber band' select text in a rectangle?
Im not sure if I have the coding mojo for that.


NoCforMe

Quote from: swordfish on September 01, 2022, 10:07:59 AM
When you said the word 'table' I was thinking a data structure type table. You want to 'rubber band' select text in a rectangle?
Im not sure if I have the coding mojo for that.

Not sure if I do either, TBH. It's a bitch of a problem. But Multi-Edit did it, so I know it's possible.

Yes, would work best with a monospaced font.
Assembly language programming should be fun. That's why I do it.

zedd151

I think I've got some ideas where to get more info on that. I think there is a useful example (in C) in win32.hlp of all places iirc. Unless I'm mistaken where I'd seen it.


Edit to add. I can't seem to find it there. I know it was a dated (Win 95-98 era) source where I'd seen the code though.
If all else fails, I could code something into a console window perhaps. That seems the most viable option. This way the internals of the console window would do the 'heavy lifting' so to speak.

NoCforMe

Mmm, don't think that's the right approach here. Don't think in terms of "what Win32 functions/controls, etc. can I use?". This is a work-it-out-with-paper-and-pencil problem. Think of an array of characters (the text): how do you select a column of them? Once you've figured that out, then you can start fleshing out the details.

At least that's the way I'm approaching it.
Assembly language programming should be fun. That's why I do it.

zedd151

It was a "last ditch" thought...
I'll tinker with this in my spare time.

zedd151

Quote from: NoCforMe on September 01, 2022, 10:01:00 AM
Multi-Edit also has really nice case-changing ops: set upper- or lowercase, capitalize first letter, etc. I miss it.


So, why aren't you still using it? (Multi-Edit)
If you need an older version than the site offers, have you tried the Wayback Machine?

fearless

Just use Notepad++ it has column selection and editing, proper, upper and lower case conversion, lines sorting and other stuff.