March 28, 2024, 01:24:10 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


"Constant" syntax coloring?

Started by paravantis, December 14, 2006, 06:52:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

paravantis

Excuse me if what I am asking is, in fact, stupid but in FILE>EDITOR OPTIONS there is "Constant Color" option that does not seem to change any syntax colors.

I have always wondered what language elements does this coloring correspond to!

(I am talking about the IDE of the new version 1.56.)

John

Steve Rusich

December 14, 2006, 07:45:21 AM #1 Last Edit: December 14, 2006, 07:50:31 AM by Steve Rusich
Quote from: paravantis on December 14, 2006, 06:52:47 AM
Excuse me if what I am asking is, in fact, stupid but in FILE>EDITOR OPTIONS there is "Constant Color" option that does not seem to change any syntax colors.

I have always wondered what language elements does this coloring correspond to!

(I am talking about the IDE of the new version 1.56.)

John

John, this is from the EBASIC user guide.


Constants and literals

Constants are identifier to numeric mappings that cannot change value. Similar to variables in that they are referred to by name but don't actually use memory or generate any code. The compiler substitutes a constant identifier with its numeric identity or string literal at compile time. The three built in statements for defining constants are CONST,ÂÃ,  SETID, and $DEFINE

The CONST statement creates traditional name to value mappings common in other languages. SETID is unique to the EBASIC language to create built in constants for the language accessed with the '@' operator. SETID constants are specially highlighted in the IDE and used throughout the command sets for built in function constants.

The $DEFINE operator is normally used to create a conditional identifier, but may also be used to create the same kind of constants that the CONST statement does. When using $DEFINE to create a constant the equal sign is not necessary.

Examples:
CONST WM_USER = 0x400
SETID "RTEDIT", 0x200
CONST ID_GAME = "Blaster Version 1.25"
CONST PI = 3.1415
$DEFINE ID_MENU 100

PRINT WM_USER, @RTEDIT, ID_GAME, PI

CONST allows basicÂÃ,  math operations to calculate a numeric identity. Since the final result must resolve to a fixed numeric value you cannot use functions or variables when calculating constants. You can however use other constant identifiers in the calculations.

CONST WM_USER = 0x400
CONST MY_MESSAGE = WM_USER + 1
CONST MY_MESSAGE2 = MY_MESSAGE + 1


Today I achieved unprecedented levels of unverifiable productivity.

paravantis

Steve,

That is what I thought too.

The problem is that the "Constant Color" found in FILE>EDITOR OPTIONS does NOT work! No matter what color I choose, no constants are highlighted in my code!

Am I the only one who is observing this behavior? Can other users report that the color they choose DOES in fact highlight their constants in the IDE?

John

Ionic Wind Support Team

Compiler constants.  @HITWINDOW for example are colored by that setting.
Ionic Wind Support Team

GWS

Yep .. works OK here ..ÂÃ, can't say I like bright purple though .. :) :) :P

Graham
Tomorrow may be too late ..

Ionic Wind Support Team

The default is an orange/brown.   What monitor are you using?
Ionic Wind Support Team

GWS

Sorry Paul .. I was just being facetious .. I've set it back to Orange- Brown of course ..  :)

Graham
Tomorrow may be too late ..

LarryMc

Quote from: Paul Turley on December 14, 2006, 09:55:32 AM
Compiler constants. 

Is there any way to make local constants defined with SETID appear highlighted?

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Ionic Wind Support Team

Not currently.  And the idea was to distinguish between constants that are built in so you don't try and redefine them.

Paul.
Ionic Wind Support Team