# Two variables in Message Box

**URL:** <https://forum.inductiveautomation.com/t/two-variables-in-message-box/9480>\
**Category:** Ignition\
**Created:** [December 23, 2014, 5:01pm UTC](https://forum.inductiveautomation.com/t/two-variables-in-message-box/9480 "2014-12-23T17:01:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jreynolds](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jreynolds](https://forum.inductiveautomation.com/u/jreynolds)\
**Post date:** [December 23, 2014, 5:01pm UTC](https://forum.inductiveautomation.com/t/two-variables-in-message-box/9480/1 "2014-12-23T17:01:48Z")

</div>

I’m try to place two variables in a message box and I’m getting this error

[code]Traceback (most recent call last):  
File “event:actionPerformed”, line 7, in   
TypeError: not enough arguments for format string

```
at org.python.core.Py.TypeError(Py.java:235)
at org.python.core.StringFormatter.getarg(PyString.java:2589)
at org.python.core.StringFormatter.format(PyString.java:2898)
at org.python.core.PyString.str ___mod__ (PyString.java:749)
at org.python.core.PyString. __mod__ (PyString.java:743)
at org.python.core.PyObject._basic_mod(PyObject.java:2673)
at org.python.core.PyObject._mod(PyObject.java:2659)
at org.python.pycode._pyx76.f$0(<event:actionPerformed>:8)
at org.python.pycode._pyx76.call_function(<event:actionPerformed>)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1275)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:554)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:155)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:266)
at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:55)
at com.sun.proxy.$Proxy19.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

```

Ignition v7.6.4 (b2013112117)  
Java: Oracle Corporation 1.7.0\_65  
[/code]

This is the Code:

```auto
system.gui.messageBox("The Threshold For '%s' Part Number '%d' has been updated to '%d'" %name %pnID %sp)
```

This is tied to a button and I only receive the error when the button is clicked.

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [December 23, 2014, 5:12pm UTC](https://forum.inductiveautomation.com/t/two-variables-in-message-box/9480/2 "2014-12-23T17:12:36Z")

</div>

Use this:

```auto
system.gui.messageBox("The Threshold For '%s' Part Number '%d' has been updated to '%d'"% (name, pnID, sp))
```

Best,

---

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [December 31, 2014, 4:43pm UTC](https://forum.inductiveautomation.com/t/two-variables-in-message-box/9480/3 "2014-12-31T16:43:23Z")

</div>

I second nmudge’s answer
