Code: Select all
Macro Test(ID, Text$, Word.s, Line.i)
; ...
EndMacro
Code: Select all
Macro Test(ID, Text$, Word.s, Line.i)
; ...
EndMacro
Code: Select all
Macro foo(iID, sText, lValue, wValue, pPointer)
;
EndMacro
Yes, that's why I chose this sign. If someone sees the suffix "$", it is immediately clear that a string is requested.skywalk wrote:The suffix '$' = String datatype.
Yes, I know. My point is that later in the code it should be recognizable whether the macro parameter requires a string or a number.skywalk wrote:Macros perform search and replace before compile. Datatypes have no meaning before compile.
Code: Select all
Macro Test(Value)
Debug Val(Value)
EndMacro
Code: Select all
Test("123")
; or
Test(123)
; I don't know... I must go to the macro definition to take a look...
Yes, this is a possibility that is immediately understandable for many programmers, although the suffix "$" would be more understandable.mk-soft wrote:Macro foo(... sText ...)
Sicro wrote:... although the suffix "$" would be more understandable.
helpy wrote:Sicro wrote:... although the suffix "$" would be more understandable.
I never use the $ sign for text variables!
Technically, even if such were to be implemented, it would purely be as syntactic sugar, with no type reflection. And the full notation would have to be expressed within the macro as well; like so:Sicro wrote:Code: Select all
Macro Test(ID, Text$, Word.s, Line.i) ; ... EndMacro
Code: Select all
Macro Test(ID, Text$, Word.s, Line.i)
Debug Word.s
Debug (Line.i + Line.i)
EndMacro
That's exactly how I imagine it. The names of the macro parameters should also be allowed to contain "$" and dot.TI-994A wrote:Code: Select all
Macro Test(ID, Text$, Word.s, Line.i) Debug Word.s Debug (Line.i + Line.i) EndMacro