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

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
will end up like

or if I have the script call directly,

Samba will just crash…


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

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 :slight_smile:)

Was there a workaround for this?

Thank you!

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

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

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]')}

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

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

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…?

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

it works perfectly fine…

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

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.

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()

1 Like

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

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:


This is the result.

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}

Yes that is correct.
image

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?

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.

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.

2 Likes

Okay! Thank you so much for your help!

Thanks Memo!

That makes perfect sense!

1 Like