"read" in Macros

Just starting out? Need help? Post your questions and find answers here.
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

"read" in Macros

Post 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?
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: "read" in Macros

Post 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.
User avatar
STARGÅTE
Addict
Addict
Posts: 2067
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: "read" in Macros

Post 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.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: "read" in Macros

Post 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
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: "read" in Macros

Post 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 :-)
Post Reply