Developing Apama Applications > Apama EPL Reference > Lexical Elements > Keywords > Escaping keywords to use them as identifiers
Escaping keywords to use them as identifiers
You can use a keyword as an identifier if you escape it with a hash symbol (#). For example:
package com.company.#monitor.client;
using com.company.#monitor.server.Event;
In a stream query, you can use a query-scope keyword as an identifier if you prefix it with a hash symbol (#). For example:
event Tick
{...
   string partition;
   ...
}
from t in all Tick() partition by t.#partition retain 5 ...
You can define a JMon event type that has a field name that is the same as an EPL keyword. To refer to that field in EPL, prefix it with a hash symbol. For example:
class MyEvent extends Event {
   int integer;
   ...
}
on all MyEvent(#integer = 5): m { ... }
To avoid warning messages if you use a reserved word as an identifier, escape the reserved word with a hash symbol (#).
Copyright © Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its Subsidiaries and or/its Affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.