Hi.
The following works fine by its self:
[code]response = fpmi.db.runScalarQuery(“select * from elan_pgres_elanhost_dig_out_ctl(‘localhost’, %d, ‘%s’, ‘Close/Open’, ‘digital-out’, ‘Direct Operate’, ‘None’, ‘Close’, ‘500’, ‘500’)” %(event.source.parent.parent.rns_port,event.source.parent.parent.Device));
fpmi.gui.messageBox(“the response for the control is %s” % response );[/code]
I cant seem to make the fpmi.gui.confirm work with it. I have tried different variations. But anyway how do I make the following to work:
[code]if fpmi.gui.confirm(“Are you sure you want to Close Switch 1 for ‘%s’?”, “Please Confirm” %event.source.parent.parent.Device):
response = fpmi.db.runScalarQuery(“select * from elan_pgres_elanhost_dig_out_ctl(‘localhost’, %d, ‘%s’, ‘Close/Open’, ‘digital-out’, ‘Direct Operate’, ‘None’, ‘Close’, ‘500’, ‘500’)” %(event.source.parent.parent.rns_port,event.source.parent.parent.Device));
fpmi.gui.messageBox(“the response for the control is %s” % response );[/code]
I get the following error:
Unable to register action mouseClicked
Parse Error:
Traceback (innermost last):
(no code object) at line 0
SyntaxError: ('invalid syntax', ('<string>', 7, 1, 'response = fpmi.db.runScalarQuery("select * from elan_pgres_elanhost_dig_out_ctl(\'localhost\', %d, \'%s\', \'Close/Open\', \'digital-out\', \'Direct Operate\', \'None\', \'Close\', \'500\', \'500\')" %(event.source.parent.parent.rns_port,event.source.parent.parent.Device));'))