Page 1 of 1

"read" in Macros

Posted: Mon Jun 03, 2019 5:25 am
by Cyllceaux
I have this macro:

Code: Select all

Structure strProject
EndStructure
Macro DeclareCRUD(Objekt)
	Declare.b create#Objekt(*objekt.str#Objekt)
	Declare read#Objekt(nr.q)
	Declare.b update#Objekt(*objekt.str#Objekt)
	Declare.b delete#Objekt(nr.q)
EndMacro

DeclareCRUD(Project)
My Problem is the Line with the "Read". It is always change "read" to Uppercase "Read". I know it is a reserved word. But what can I do?

Re: "read" in Macros

Posted: Mon Jun 03, 2019 5:30 am
by Cyllceaux
At the moment I do this:

Code: Select all

Macro DeclareCRUD(Objekt)
	Declare.b _create#Objekt(*objekt.str#Objekt)
	Declare _read#Objekt(nr.q)
	Declare.b _update#Objekt(*objekt.str#Objekt)
	Declare.b _delete#Objekt(nr.q)
EndMacro
But for a DLL it doesn't look good.

Re: "read" in Macros

Posted: Mon Jun 03, 2019 6:29 am
by STARGĂ…TE
Why do you claim the behavior as a bug?
As you wrote, Read is a reserved keyword.
You can disable the case correction in the preferences.

Re: "read" in Macros

Posted: Mon Jun 03, 2019 6:41 am
by #NULL
Ugly, but here it is :) :

Code: Select all

Structure strProject
EndStructure
Macro DeclareCRUD_re :re: EndMacro
Macro DeclareCRUD_ad :ad: EndMacro
Macro DeclareCRUD(Objekt)
  Declare.b create#Objekt(*objekt.str#Objekt)
  Declare DeclareCRUD_re#DeclareCRUD_ad#Objekt(nr.q)
  Declare.b update#Objekt(*objekt.str#Objekt)
  Declare.b delete#Objekt(nr.q)
EndMacro

DeclareCRUD(Project)
If Defined(updateProject, #PB_Procedure)
  Debug "defined"
EndIf

Re: "read" in Macros

Posted: Mon Jun 03, 2019 7:57 am
by Cyllceaux
Ugly is not the perfect word.. but it's what I'm looking for. thx :)


If it's not a bug, this topic can move to tips/tricks :-)