Skip to main content

Defining the PlayingNow Property

Let's add one more property, PlayingNow, which indicates whether or not the film is currently playing. It illustrates the use of another built-in data type, %BooleanOpens in a new tab, which accepts values of 0 (for false) and 1 (for true.). The initial value for PlayingNow is 1.

Either add the property directly to Film or use the New Property Wizard.

When you are finished, your Cinema.FilmOpens in a new tab class definition should look something like the following:

Class Cinema.Film Extends %Persistent 
{
/// Title of a film
Property Title As %String [ Required ];

/// Index for property Title
Index TitleIndex On Title;

Property Description As %String(MAXLEN = 300);

Property TicketsSold As %Integer [ InitialExpression = 0 ];

/// Index for property TicketsSold
Index TicketsSoldIndex On TicketsSold;

Property PlayingNow As %Boolean [ InitialExpression = 1 ];

}
FeedbackOpens in a new tab