News:

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

Main Menu

Recent posts

#91
The Workshop / Re: FputoString format
Last post by guga - May 24, 2025, 11:44:38 AM
Hi David. Yes, I agree. I usually opt for the simplest way. I'm updating another function that I created specifically for these conversions, but I got confused when I looked at the format that the M$ printf function exported when it came to FPU. I found it very strange. Unfortunately, it seems that some people use this, so I'm going to try to do as Raymond suggested and implement this as an option. The problem is trying to do it in a way that doesn't change the functionality too much (I mean, the processing speed). The worst thing is that I've already finished the function, it was ready, but I tried to look at this M$ function to see if I could adapt it to other ways of representing the FPU and I came across this weird format of 0.000e+00 etc.

#92
Showcase / Re: mcLB2, a new Windows contr...
Last post by sinsi - May 24, 2025, 08:55:26 AM
Quote from: NoCforMe on May 24, 2025, 05:03:54 AMYes, except that I need to locate the master control structure for each control.
Why do that, when each control has it's data within?
Let Windows keep track of controls, your code's job is to act on the control.

I use WM_NCCREATE because there are some things that are needed well before we receive a WM_CREATE and it's the first message posted.
Same reason for using WM_NCDESTROY, it's the final one received. I read this tip in a Windows 95 Programming book, I'll see if I can find it and post the reasoning behind it.
#93
Showcase / Re: mcLB2, a new Windows contr...
Last post by _japheth - May 24, 2025, 05:26:58 AM
Quote from: NoCforMe on May 24, 2025, 05:03:54 AMOne thing I found annoying was that in order to delete rows in a ListView you have to start at the end and work your way backwards.

:biggrin:

I guess that's just a "misunderstanding" on your side - i.e to delete rows 10-12 in a listview of 20 rows, you probably should take into account that after deleting row 10, the former rows 11-12 have become rows 10-11 ( IOW: to delete rows 10-12 you just have to delete row 10 3 times ).



#94
The Workshop / Re: FputoString format
Last post by NoCforMe - May 24, 2025, 05:07:30 AM
Quote from: guga on May 23, 2025, 10:17:45 PMHi Guys

I`m updating a FputoString function and have some doubts about the scientific output format. In normal printf it seems that when dealing with Floating points, 0 can be represented as: 0.00000e+00, 0.00000e-00, or 0.000000 etc etc, right ?

My question is...this format to represent 0 is really necessary ? Shouldn´t it be simpler to represent it as a single 0 ?

What´s the purpose of using formats such as: 0.00000e+00, 0.000 etc etc ?

False precision is all I can think of.

Heh; I'm always amused by seeing things on Microsoft Learn where they give constants like "0x00000001", where a simple "1" would suffice.
#95
Showcase / Re: mcLB2, a new Windows contr...
Last post by NoCforMe - May 24, 2025, 05:03:54 AM
Quote from: sinsi on May 22, 2025, 11:05:15 PM
Quote from: NoCforMe on May 22, 2025, 02:40:30 PM4. Should the user be able to change column characteristics (font, text & background colors) on the fly? Currently these are set at control-creation time and can't be changed thereafter.
Yes to all three, what is legible to you may just be blobs to another.
Yes, but all of these can be set when the control is created; are you suggesting being able to change them after creation? Could be done, with a bit of complexity.

QuoteI would't personally use it as I think a ListView is easier
Now that's an interesting data point, so noted: I haven't seen much interest in using this yet here, so it might just end up being another one of my private custom controls.

But really, is it easier for you to use a ListView? I'm surprised, as I find that control's interface to be a hot mess. But maybe you've figured it out and have a set of routines to handle it. One thing I found annoying was that in order to delete rows in a ListView you have to start at the end and work your way backwards.

Quote from: sinsi on May 23, 2025, 03:56:30 PMA control should be self-contained, so use a structure for per-instance data (per control).
When you register the class, add 4 bytes (SIZEOF PTR) to WNDCLASSEX.cbWndExtra. This would be a pointer to any private data, stored in a structure.
Good suggestion (and easy to implement) on the private data, always a handy thing.
The control is that way now, with a "master control structure" ($mcs2) for each instance.

QuoteOn WM_NCCREATE you would allocate memory for the structure and initialise it, using SetWindowLong to save it to that control.
I do this, but on WM_CREATE instead. No need to use SetWindowLong(), as all that is done internally. But yeah, basically the same scheme.

QuoteNo need to keep track of created controls, the HWND takes care of finding the data.
Yes, except that I need to locate the master control structure for each control. I suppose you could use GWL_USERDATA as a pointer to that structure. (I have a routine, FindControl()) which locates the structure using the handle passed into the control's proc.)
#96
The Workshop / Re: FputoString format
Last post by guga - May 24, 2025, 03:41:25 AM
Thanks guys

Hi Raymond, thanks. I was thinking about removing this and keeping just 0, but maybe it would be better to add an optional flag in case someone wants this kind of output. I don't see any use for it, but maybe it will be useful for others.
#97
The Workshop / Re: FputoString format
Last post by raymond - May 24, 2025, 02:52:47 AM
QuoteShouldn´t it be simpler to represent it as a single 0 ?

That was the philosophy for the FpuFLtoA function of the Fpulib, although it did include the possibility of front padding with spaces for potential "alignment" of the decimal delimiter when specified.

If you can have a logical reason to offer some other different option in your own functions, it would be entirely up to you (and be entirely acceptable as always).
#98
The Workshop / Re: FputoString format
Last post by FORTRANS - May 24, 2025, 01:14:05 AM
Hi,

Quote from: guga on May 23, 2025, 10:17:45 PMWhat´s the purpose of using formats such as: 0.00000e+00, 0.000 etc etc ?

   The first thing that comes to mind is output alignment.  Or "pretty
printing".

Regards,

Steve N.
#99
The Workshop / Re: FputoString format
Last post by daydreamer - May 24, 2025, 12:35:57 AM
Quote from: guga on May 23, 2025, 10:17:45 PMHi Guys

I`m updating a FputoString function and have some doubts about the scientific output format. In normal print it seems that when dealing with Floating points, 0 can be represented as: 0.00000e+00, 0.00000e-00, or 0.000000 etc etc, right ?

My question is...this format to represent 0 is really necessary ? Shouldn´t it be simpler to represent it as a single 0 ?

What´s the purpose of using formats such as: 0.00000e+00, 0.000 etc etc ?
real4 and dword have in common zeros have same encoding,so if you want to you could use conditional jump and print "0",if you discover a zero
 
#100
The Workshop / FputoString format
Last post by guga - May 23, 2025, 10:17:45 PM
Hi Guys

I`m updating a FputoString function and have some doubts about the scientific output format. In normal printf it seems that when dealing with Floating points, 0 can be represented as: 0.00000e+00, 0.00000e-00, or 0.000000 etc etc, right ?

My question is...this format to represent 0 is really necessary ? Shouldn´t it be simpler to represent it as a single 0 ?

What´s the purpose of using formats such as: 0.00000e+00, 0.000 etc etc ?