I know that the preprocessor has the capability of evaluating a constant expression because it does it on the #IF command.
Therefore I would like to see a command like:
the result of this command would be to create a #define name with either the value of the string expression specified or the STR(numeric expression). In addition if name exists, then replace the current value of name with the value of the expression.
So.
would replace the #define name "a" with the current value of a+1
This would be great in creating unique variable/label names. Or keep track of the next location in an array. It would make creating complex data structures at compile time a lot easier. All this done at compile time.
In fbc-1.08 can kind of do this. Not quite as nice as the proposed
EQU sym exprsyntax though. In this example, symbol name has to be quoted otherwise it gets replaced with the value of the symbol.EQU( "sym", expr )Last edit: Jeff Marshall 2020-11-09
Thank you very much.
Wally
On November 8, 2020, at 7:13 PM, Jeff Marshall jeffmarshall@users.sourceforge.net wrote:
In fbc-1.08 can kind of do this. Not quite as nice as the proposed EQU sym expr syntax though. In this example, symbol name has to be quoted otherwise it gets replaced with the value of the symbol. EQU( "sym", expr )
[feature-requests:#312] Additional Preprocessor command
Status: open
Labels: preprocessor
Created: Tue Dec 17, 2019 05:35 AM UTC by Wally Gazdzik
Last Updated: Tue Dec 17, 2019 05:35 AM UTC
Owner: nobody
I know that the preprocessor has the capability of evaluating a constant expression because it does it on the #IF command.
Therefore I would like to see a command like:
EQU name constant expression
the result of this command would be to create a #define name with either the value of the string expression specified or the STR(numeric expression). In addition if name exists, then replace the current value of name with the value of the expression.
So.
EQU a a+1
would replace the #define name "a" with the current value of a+1
This would be great in creating unique variable/label names. Or keep track of the next location in an array. It would make creating complex data structures at compile time a lot easier. All this done at compile time.
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/fbc/feature-requests/312/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
Related
Feature Requests: #312
Last edit: Jeff Marshall 2020-11-09