Re: [BLACKBOX] Line numbers in BB editor

From: [at]} <Werner>
Date: Sat, 6 Nov 2010 09:02:43 +0100

----boundary-LibPST-iamunique-1272072220_-_-
Content-type: text/plain

> Hi:
>
> I am using BB editor to develop a C program (yes, I know, I know...).
> The C-compiler spits error messages with line numbers. It would be
> convenient to request the BB editor to jump to a given line number. Is
> there a known method to do so?

Try this as a starting point ... it displays the current line number

PROCEDURE CaretPos*;
(* Get the Row-Position of the Caret in current Text-Focus and Display Status-Line *)
        VAR pos : INTEGER; controller : TCo.Controller; rd : TMo.Reader; num : ARRAY 256 OF CHAR;
        BEGIN
                (* Get Row-Pos of Caret/ErrorMark and Display *)
                controller := TCo.Focus();
                IF controller # NIL THEN
                        rd := controller.text.NewReader(NIL); rd.SetPos(0); pos := 0;
                        WHILE rd.Pos() < controller.CaretPos() DO
                                rd.Read; IF rd.char = TMo.line THEN INC(pos) END;
                        END;
                        Str.IntToString(pos+1,num); (* First Line is Line 1 *)
                        Dialog.ShowStatus("Caret at row " + num);
                ELSE
                        Dialog.ShowStatus("Focus View is no text");
                END;
        END CaretPos;

I do the other way round ... i use an text-editor (KDE-Kate) to edit CP-Sources ...
When i compile and jump to the error mark i hit F2 (made a menu-entry for that)
and voila i do get the line Number ...

you probably will use controller.SetCaret to set the caret to where you like



Its from our module O3bbDev ... included in our WebApp-Framework




mit freundlichen Grüssen

Werner Braun

Mobil +49 (0)178 145 8768 * Fon +49 (0)431 556 8907-1 * Fax +49 (0)431 556 8907-9

O³ Software GmbH & Co. KG * Franziusallee 131 * D-24148 Kiel * Germany
Sitz der Gesellschaft Kiel * HR Amtsgericht Kiel HRA 6418 KI
Persönlich haftende Gesellschafterin O³ Software GmbH * HR Amtsgericht Kiel HRB 10335 KI * Geschäftsführer Werner Braun


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1272072220_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rt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hcg0K
XHBhcg0KXHBhcg0KLS0tLVxwYXINClRvIHVuc3Vic2NyaWJlLCBzZW5kIGEgbWVzc2FnZSB3aXRo
IGJvZHkgIlNJR05PRkYgQkxBQ0tCT1giIHRvIExJU1RTRVJWQExJU1RTLk9CRVJPTi5DSH19AAAA
BAA
----boundary-LibPST-iamunique-1272072220_-_---
Received on Sat Nov 06 2010 - 09:02:43 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:28 UTC