BBC BASIC for Windows
IDE and Compiler >> Integrated Development Environment >> EM_LINEINDEX and EM_LINELENGTH message for the IDE
http://bb4w.conforums.com/index.cgi?board=ide&action=display&num=1294857988

EM_LINEINDEX and EM_LINELENGTH message for the IDE
Post by Michael Hutton on Jan 12th, 2011, 5:46pm

Hi Richard,

As you have previously stated:

Quote:
Bear in mind that the BB4W program editor isn't a Windows edit control; it doesn't (in general) respond to EM_ messages, and those few it does respond to often don't work the way you might expect (since BB4W both sends and receives the messages, they are treated as 'private' messages, with custom content, even if they 'borrow' official Windows message numbers).


I notice that the EM_LINEINDEX and EM_LINELENGTH messages also seem not to work in a standard way (else I have completely <insert expletive here> up my code, which I have to agree, is highly likely).

Are there 'simple' replacements for these or should I just use the EM_GETLINE message (which I know works) to get the linelength?

It is not really an issue but I thought I would ask.

Michael
Re: EM_LINEINDEX and EM_LINELENGTH message for the
Post by admin on Jan 12th, 2011, 9:29pm

on Jan 12th, 2011, 5:46pm, Michael Hutton wrote:
I notice that the EM_LINEINDEX and EM_LINELENGTH messages also seem not to work in a standard way

EM_LINELENGTH isn't used at all. EM_LINEINDEX is partially implemented, but the value it returns is not the offset from the start of the program but the absolute memory address. If you know the value of PAGE by other means, you can subtract it from the returned value to get the offset.

Richard.

Re: EM_LINEINDEX and EM_LINELENGTH message for the
Post by Michael Hutton on Jan 13th, 2011, 03:52am

OK, thank you. I was using some other code pasted into a new program and was confused by the apparent bug. It is easy this end to use a 'work round'.

Michael

Re: EM_LINEINDEX and EM_LINELENGTH message for the
Post by rtr2 on Jan 19th, 2015, 4:35pm

on Jan 12th, 2011, 9:29pm, admin wrote:
If you know the value of PAGE by other means, you can subtract it from the returned value to get the offset.

BB4W v6.00a provides an 'official' way of obtaining the value of PAGE by means of a new message WMU_GETPAGE which has the value 1047. It takes no parameters (wParam and lParam are ignored).

Richard.