# Print last choice point - Reply 1

**URL:** <https://swi-prolog.discourse.group/t/print-last-choice-point-reply-1/4724>\
**Category:** General\
**Created:** [December 6, 2021, 11:22pm UTC](https://swi-prolog.discourse.group/t/print-last-choice-point-reply-1/4724 "2021-12-06T23:22:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [December 6, 2021, 11:22pm UTC](https://swi-prolog.discourse.group/t/print-last-choice-point-reply-1/4724/1 "2021-12-06T23:22:01Z")

</div>

I guess you can finally cross that one off of your bucket list. I know it has been there for a very long time. 😀

However, what if the predicate has more than one choice point, wouldn’t the answer be a list?

---

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [December 6, 2021, 11:31pm UTC](https://swi-prolog.discourse.group/t/print-last-choice-point-reply-1/4724/2 "2021-12-06T23:31:39Z")

</div>

A post was split to a new topic: [Print last choice point - Reply 2](https://swi-prolog.discourse.group/t/print-last-choice-point-reply-2/4725)

---

<div class="post-metadata">

**Author:** ![swi](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@swi](https://swi-prolog.discourse.group/u/swi)\
**Post date:** [December 6, 2021, 11:30pm UTC](https://swi-prolog.discourse.group/t/print-last-choice-point-reply-1/4724/3 "2021-12-06T23:30:34Z")

</div>

It prints only the last choice point left (if any) in the current environment:

From [SWI-Prolog -- Manual](https://www.swi-prolog.org/pldoc/man?section=manipstack:)

> Unify Choice with an integer provided a reference to the last choice point. Fails if the current environment has no choice points. See also [prolog\_choice\_attribute/3](https://www.swi-prolog.org/pldoc/man?predicate=prolog_choice_attribute/3).
