I use often this macro that return the adress of the chain
Quote
CREDATA MACRO quoted_text:REQ,NomdeChaine
LOCAL Local_Etiquette,verif
IFNB <NomdeChaine> ;present
verif SUBSTR <NomdeChaine>,1,1
IFIDN verif,<"> ;first char is "
.ERR <ETIQUETTE SUPRIMER les " >
ENDIF
Local_Etiquette TEXTEQU <NomdeChaine>
ENDIF
verif SUBSTR <quoted_text>,1,1
IFDIF verif,<">
.ERR <CHAINE AJOUTER LES " >
ENDIF
.data
Local_Etiquette db quoted_text,0
.code
EXITM <Local_Etiquette>
ENDM
; ----------------------------------------------------
; return adress of the created chain, SADR("chaine")
; -----------------------------------------------------
SADR MACRO quoted_text:REQ,NomdeChaine
EXITM <ADDR CREDATA(quoted_text,NomdeChaine)>
ENDM
Works well until i use it like that , SADR("!DefaultKeywordIndex")
The "!" disappear from the chain in data ???????????
The following macro don't made this.
Quote
reparg MACRO arg
LOCAL nustr
quot SUBSTR <arg>,1,1
IFIDN quot,<"> ;; if 1st char = "
.data
nustr db arg,0 ;; write arg to .DATA section
.code
EXITM <ADDR nustr> ;; append name to ADDR operator
ELSE
EXITM <arg> ;; else return arg
ENDIF
Perhaps someone have an answer ?
> Perhaps someone have an answer ?
I not only have an answer but also a suggestion how to implement a workaround.
The problem is if a literal contains '!' and is used in angle brackets (i.e. as a macro parameter), the '!' becomes an operator (MS calls it the "literal character" operator).
In you sample, you can avoid '!' becoming an operator if you change your SADR macro a bit:
SADR MACRO quoted_text:REQ,NomdeChaine
EXITM @CatStr(<ADDR >, CREDATA(quoted_text,NomdeChaine))
ENDM
Many thanks