flat assembler
Message board for the users of flat assembler.

Index > IDE Development > Suggestion to Display macor lib for Fresh.

Author
Thread Post new topic Reply to topic
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 27 Oct 2003, 13:53
I've noticed that Fresh can assign icons to the output when the first byte is a digit (currently 0>x<4), so what about making a few small macros that make use of them. I wonder what you (especially JohnFound, maybe this isn't the intended usage, sorry if not) think of them.

Code:
; freshio.inc - include fresh display macros

; Icons:
 FRESH_ICON_WARNING = 1
 FRESH_ICON_ERROR   = 2
 FRESH_ICON_INFO    = 3

macro DispWarn [msg] { common display FRESH_ICON_WARNING, msg}
macro DispErr  [msg] { common display FRESH_ICON_ERROR,   msg}
macro DispInfo [msg] { common display FRESH_ICON_INFO,    msg}

macro DispTodo [msg] { common display FRESH_ICON_INFO,    'TODO: ',msg}
macro DispBug  [msg] { common display FRESH_ICON_WARNING, 'BUG: ', msg}

;Usage:
;DispWarn 'Warnign Message',13,10
;DispErr  'Error Message',13,10
;DispInfo 'Info Message',13,10
;DispTodo 'Implent FooBar processing',13,10
;DispBug  'There is a bug here, needs to be fixed!',13,10     
; output:
[warning icon] Warnign Message
[error icon] Error Message
[info icon] Info Message
[info icon] TODO: Implent FooBar processing
[warning icon] BUG: There is a bug here, needs to be fixed!
    

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 27 Oct 2003, 13:53
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 27 Oct 2003, 14:14
Hi Scientica.
Very good idea. Only few notes:

1. The numbers of the icons are between 1 and 4. (Number 4 is empty now) but it is not problem this count to be increased.)
2. The icon number is not neccessary the first char in the message. Actually it have to be inside the message and before CR character. If more than one char with ascii 1..4 exists in the message, the last is valuable.
3. The message have to end with CR (or LF or CR_LF, or LF_CR) because I separate different rows in ListView control by CR_LF at the end.

I think to make possible to be inserted filename/line number info in the messages, but this is for future, because it needs compiler modifications.

Regards.
Post 27 Oct 2003, 14:14
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 27 Oct 2003, 15:10
JohnFound wrote:
Hi Scientica.
Very good idea. Only few notes:

1. The numbers of the icons are between 1 and 4. (Number 4 is empty now) but it is not problem this count to be increased.)
2. The icon number is not neccessary the first char in the message. Actually it have to be inside the message and before CR character. If more than one char with ascii 1..4 exists in the message, the last is valuable.
3. The message have to end with CR (or LF or CR_LF, or LF_CR) because I separate different rows in ListView control by CR_LF at the end.

I think to make possible to be inserted filename/line number info in the messages, but this is for future, because it needs compiler modifications.

Regards.

1 & 2. Ok, but wouldn't it be better to have the first char determinate the icon, and create a DispMsg a macro that uses the "no icon" as the first char? (or possibly override the display directive). Since some people might want to print out some chars like tab (0x9).
3. Should I make the macros append ,13,10 ?

I too think we should have some file-name, line-number pseudoMacros/pseudoEquates

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 27 Oct 2003, 15:10
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 27 Oct 2003, 15:50
scientica wrote:
1 & 2. Ok, but wouldn't it be better to have the first char determinate the icon, and create a DispMsg a macro that uses the "no icon" as the first char? (or possibly override the display directive). Since some people might want to print out some chars like tab (0x9).


Only ASCII codes 1..4 behaves that way. I don't think someone will use them for any other purpose. BTW: List view control doesn't allow even tab character to be used in the text.

Quote:
3. Should I make the macros append ,13,10 ?


Yea. Only one of them will be enough.
Post 27 Oct 2003, 15:50
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 27 Oct 2003, 17:07
Here's the latest version:
Code:
; freshio.inc - include fresh display macros

; Icons:
 FRESH_ICON_WARNING = 1
 FRESH_ICON_ERROR   = 2
 FRESH_ICON_INFO    = 3
 FRESH_ICON_NONE    = 4

macro DispWarn [msg] { common display msg,FRESH_ICON_WARNING, 10}
macro DispErr  [msg] { common display msg,FRESH_ICON_ERROR,   10}
macro DispInfo [msg] { common display msg,FRESH_ICON_INFO,    10}
macro display  [msg] { common display msg,FRESH_ICON_NONE}        ; over ride of the display directive. Sould make sure that "normal" displays don't have any icon.

macro DispTodo [msg] { common DispInfo 'TODO: ',msg }
macro DispBug  [msg] { common DispWarn 'BUG: ', msg }

;Usage:
;include '<path>\freshio.inc'
;DispWarn 'Warning Message'
;DispErr  'Error Message'
;DispInfo 'Info Message'
;DispTodo 'Implent FooBar processing'
;DispBug  'There is a bug here, needs to be fixed!'
;
;display "test string1",10
;display "test string3",1,5,2    

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 27 Oct 2003, 17:07
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.