# \[?Prompt\] with a {CALL:x} or any setting with a colon( : ) in it

**URL:** <https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925>\
**Category:** V5 Question\
**Created:** [September 11, 2020, 6:30am UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925 "2020-09-11T06:30:20Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![BCEats](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/4491bb/32.png) [@BCEats](https://forum.sambapos.com/u/BCEats)\
**Post date:** [September 11, 2020, 6:30am UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925/1 "2020-09-11T06:30:20Z")

</div>

Hi!

I am currently trying to setup a prompt to set the Pickup Minutes for pickup orders.  
I have a script that gets the Total amount of orders in the system already, how much the ticket total is, and will return a recommended/reference time.

I would like the prompt to be:

How many minutes? Recommended: 30 min []  
[1] [2] [3]  
[4] [5] [6]  
[7] [8] [9]  
[←] [0] [OK]

but I can not seem to get the prompt to work when there is a colon( : ) in the [?prompt]  
 ![image](https://forum.sambapos.com/uploads/default/original/3X/1/0/10cf656d0dab57c91cdf16340315e41bbcd6d274.png)  
will end up like

 ![image](https://forum.sambapos.com/uploads/default/original/3X/9/9/99701f1c48ec1b4b12101c5e9afec828f9690db7.png)

or if I have the script call directly,

 ![image](https://forum.sambapos.com/uploads/default/original/3X/0/d/0d370e87c1016d08d7f76e2bf96cfe1048b4c485.png)

Samba will just crash…

 ![image](https://forum.sambapos.com/uploads/default/original/3X/b/9/b9be31c63e3938b3d19ff164a29aee6005ebb2e0.png)  
Emre has mentioned in the post below that the error “initialization of devexpress.xpf.editors.textedit threw an exception” is from a syntax error in the regular expression

> [@Crash when trying to display a \[?Prompt\]](https://forum.sambapos.com/t/crash-when-trying-to-display-a-prompt/18958/4):
>
> The syntax for [?prompt] is [?\<prompt\>;\<mask\>;\<default value\>;\<flags\>;\<keycodes\>] \<mask\> part evaluates as a regular expression. As the error message says there is a syntax error in regular expression, probably part of your CALL result reads as mask. Edit: Only the first item of the list can be selected as default. To do that you can start value list with a \* character like \*Option1|Option2|Option3. Selecting values other than first value by default not implemented yet.

I’m assuming that the error comes from the colon.

I have tried:  
[?How many minutes? “{LOCAL SETTING:refTime}”;([1-9]|[1-9][0-9]);;CON;]  
[?How many minutes? ‘{LOCAL SETTING:refTime}’;([1-9]|[1-9][0-9]);;CON;]  
[?How many minutes? {LOCAL SETTING(: )refTime};([1-9]|[1-9][0-9]);;CON;] (I put a space after the colon…because… smiley face 🙂)

Was there a workaround for this?

Thank you!

---

<div class="post-metadata">

**Author:** ![Memo](https://forum.sambapos.com/user_avatar/forum.sambapos.com/memo/32/55443_2.png) [@Memo](https://forum.sambapos.com/u/Memo)\
**Post date:** [September 11, 2020, 7:07am UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925/2 "2020-09-11T07:07:24Z")

</div>

`[?How many minutes?;\d{1,};;OCN]`

That will only accept positive integers of at least 1 digit and display only they keypad.

---

<div class="post-metadata">

**Author:** ![Memo](https://forum.sambapos.com/user_avatar/forum.sambapos.com/memo/32/55443_2.png) [@Memo](https://forum.sambapos.com/u/Memo)\
**Post date:** [September 11, 2020, 7:29am UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925/3 "2020-09-11T07:29:10Z")

</div>

Sorry, I’m still waking up:

So, if you need to pass your prompt value and some setting to a script, it’d be better to pass them as separate parameters e.g. `{CALL:script.test('{LOCAL SETTING:refTime}','[?How many minutes?;\d{1,};;OCN]')}`

---

<div class="post-metadata">

**Author:** ![Bob\_be](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@Bob\_be](https://forum.sambapos.com/u/Bob_be)\
**Post date:** [September 11, 2020, 12:20pm UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925/4 "2020-09-11T12:20:25Z")

</div>

It looks like you have your syntax wrong. Take a look at this post from QMcKay:

> [@Custom Keyboard Codes](https://forum.sambapos.com/t/custom-keyboard-codes/3006):
>
> As of v4.1.61 we can create Custom Keyboards to use with [?prompt] notation, and a Custom Keyboard Widget is available for Entity Screens. For [?prompt] notation, the syntax is: [?\<prompt\>;\<mask\>;\<default value\>;\<flags\>;\<keycodes\>] \<prompt\> is the question or prompt to display \<mask\> is a regular expression to define what type of characters (and how many) are allowed \<default value\> allows for a common value to be pre-entered \<flags\> lets you define the keyboard type and which buttons …

---

<div class="post-metadata">

**Author:** ![BCEats](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/4491bb/32.png) [@BCEats](https://forum.sambapos.com/u/BCEats)\
**Post date:** [September 12, 2020, 1:55am UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925/5 "2020-09-12T01:55:16Z")

</div>

Hmm, well the things is I would like to have the {CALL} inside of the prompt so it displays a reference time, that way the servers can easily tell the customers how long until order is ready, instead of asking the chefs how long each time.

So I would like to make the prompt display like

 ![image](https://forum.sambapos.com/uploads/default/original/3X/f/1/f14067de1952cfab859712272bd4e954906dc8c8.png)

To do that I would need to have the {CALL:x} or a {LOCAL SETTING:x} inside of the [?Prompt], unless there was an easier way of doing that, and I’m making things harder for myself…?

---

<div class="post-metadata">

**Author:** ![BCEats](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/4491bb/32.png) [@BCEats](https://forum.sambapos.com/u/BCEats)\
**Post date:** [September 12, 2020, 1:57am UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925/6 "2020-09-12T01:57:22Z")

</div>

So when I remove the {CALL:x} or the {LOCAL SETTING:x} from the [?Prompt] like such:

 ![image](https://forum.sambapos.com/uploads/default/original/3X/4/d/4d1987db83eec6c58ef87da0415f465e6df319e9.png)

it works perfectly fine…

 ![image](https://forum.sambapos.com/uploads/default/original/3X/3/e/3e23ac0e7089f236a50073768a9b2b89ca7f7371.png)

So I’m assuming the colon messes with the syntax?

---

<div class="post-metadata">

**Author:** ![Bob\_be](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@Bob\_be](https://forum.sambapos.com/u/Bob_be)\
**Post date:** [September 12, 2020, 5:21am UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925/7 "2020-09-12T05:21:52Z")

</div>

Colons does not break the prompt…at least in the default values section. I use Local Settings and Reports all the time and it doesn’t mess with the prompt. What usually does mess with prompt’s is square brackets `[] ` in the default values section. I don’t know if you are trying to call something that has square brackets or not.

I’m not sure if the 2nd question mark would have any effect. Try removing it for now, to make sure that isn’t interfering with anything.

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [September 12, 2020, 10:34am UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925/8 "2020-09-12T10:34:44Z")

</div>

Call a script and put the ask question inside the script with the script returning the entered earlier.  
You can build the string for the question within the script.  
dlg.EditValue()

---

<div class="post-metadata">

**Author:** ![Memo](https://forum.sambapos.com/user_avatar/forum.sambapos.com/memo/32/55443_2.png) [@Memo](https://forum.sambapos.com/u/Memo)\
**Post date:** [September 12, 2020, 6:54pm UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925/9 "2020-09-12T18:54:08Z")

</div>

WHat are you doing with the input once entered? Does the ‘Update Pickup Minutes’ update a ticket tag?

---

<div class="post-metadata">

**Author:** ![BCEats](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/4491bb/32.png) [@BCEats](https://forum.sambapos.com/u/BCEats)\
**Post date:** [September 13, 2020, 7:15pm UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925/10 "2020-09-13T19:15:49Z")

</div>

I also thought about the second “?”, and did try that…and the reason why I thought the colon throws the error is when I do that:

 ![image](https://forum.sambapos.com/uploads/default/original/3X/e/a/ea91f0764e668cc379aa28b3377ed6d981c68681.png)  
This is the result.  
 ![image](https://forum.sambapos.com/uploads/default/original/3X/6/5/659cc798e2c38593cf1c8196ab85a8d297159ee3.png)

Which I find odd, because the colon is in the first part then it reads “refTime}etc” to the Mask section.

The call function returns.  
“x Min” OR “ASK CHEF”, where x is an INT ranging from 10 to 99.

The {CALL:x} function is saved to {Local setting:refTime}

---

<div class="post-metadata">

**Author:** ![BCEats](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/4491bb/32.png) [@BCEats](https://forum.sambapos.com/u/BCEats)\
**Post date:** [September 13, 2020, 7:18pm UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925/11 "2020-09-13T19:18:54Z")

</div>

Yes that is correct.  
 ![image](https://forum.sambapos.com/uploads/default/original/3X/7/7/77fb568cf8b2695e7204fc614720ad8749dcdaad.png)

---

<div class="post-metadata">

**Author:** ![BCEats](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/4491bb/32.png) [@BCEats](https://forum.sambapos.com/u/BCEats)\
**Post date:** [September 13, 2020, 7:19pm UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925/12 "2020-09-13T19:19:58Z")

</div>

Thank you so much! I will play around with that!

Was there anything wrong with what I had done or, would this be the only way?

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [September 13, 2020, 7:25pm UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925/13 "2020-09-13T19:25:48Z")

</div>

There are limits to some expressions when compounding, sometimes it won’t work as inner expression not parsed other times characters can mess up the syntax.  
Use call to run a script, render your question string in the script so its a single var and use the dlg helper to put your ?prompt within the script. And the script return the entered value back to the action the script origiknally called.

---

<div class="post-metadata">

**Author:** ![Memo](https://forum.sambapos.com/user_avatar/forum.sambapos.com/memo/32/55443_2.png) [@Memo](https://forum.sambapos.com/u/Memo)\
**Post date:** [September 13, 2020, 7:54pm UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925/14 "2020-09-13T19:54:29Z")

</div>

So the extra question mark isn’t the problem. It seems to be the braces within the prompt text. I get a crash with just` [?{SETTING:SOMESETTING}]`.

Anyhoo, here’s a script for the time being:

```
//{CALL:promiseTime.prompt('{LOCAL SETTING:refTime}')}
function prompt(refTime)
{
  var r = dlg.EditValue("How many minutes? " + refTime + ";[0-9]*[1-9][0-9]*;;OCN","");
  return r;
}

```

place this in ‘Minutes’: `{CALL:time.prompt('{LOCAL SETTING:refTime}')}`

The prompt will allow any positive, non-zero integer.

---

<div class="post-metadata">

**Author:** ![BCEats](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/4491bb/32.png) [@BCEats](https://forum.sambapos.com/u/BCEats)\
**Post date:** [September 14, 2020, 1:19am UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925/15 "2020-09-14T01:19:23Z")

</div>

Okay! Thank you so much for your help!

---

<div class="post-metadata">

**Author:** ![BCEats](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/4491bb/32.png) [@BCEats](https://forum.sambapos.com/u/BCEats)\
**Post date:** [September 14, 2020, 1:24am UTC](https://forum.sambapos.com/t/prompt-with-a-call-x-or-any-setting-with-a-colon-in-it/22925/16 "2020-09-14T01:24:19Z")

</div>

Thanks Memo!

That makes perfect sense!
