Form1 Form1 0 0 553 325 Variable passing demo with PHP image0 AboutDialog1.initialize("Variable passing demo", "", "0.1", "Copyright 2008") AboutDialog1.addAuthor("Eric Laffoon", "Designer", "eric@tdewebdev.org", "http://kittyhooch.com") AboutDialog1.setHomepage("http://kommander.tdewebdev.org") AboutDialog1.setBugAddress("eric@tdewebdev.org") AboutDialog1.setDescription("Demo of passing arguments to and from scripts, You can also pass an echo to stdout back from your script by calling your script with echo(ScriptObject.execute)") AboutDialog1.setLicense("GPL_V2") PopupMenu1.insertMenuItem("Help About", "PopupMenu1", 1) if str_length(exec("ls -1 /usr/bin/php")) == 0 then message_error("This dialog requires command line PHP installed as /usr/bin/php in order to show the external script functions with PHP. if it is installed elsewhere you could edit the PHP script sheebang in the dialog or create a symlink on your system.", "PHP not detected") endif true unnamed 11 6 Label8 Value to pass back ExecButton3 1 4 0 0 Pass I&nternally ret = ScriptObject2.execute(LineEdit7.text, LineEdit1.text, LineEdit2.text) LineEdit6.setText(ret) Label9 Set AlignVCenter|AlignRight Label6_2 Pass back AlignVCenter|AlignRight ExecButton72 1 4 0 0 P&ass to PHP Script // test for PHP pt = exec("php --version") if str_contains(pt, "Zend") then php = ScriptObjectPHP.execute(LineEdit7.text,LineEdit1.text,LineEdit2.text) LineEdit4.setText(php) else message_error("It looks like PHP CLI is not installed and on your path") endif Label6 Pass back AlignVCenter|AlignRight Label5 Set with @ AlignVCenter|AlignRight Label37 Return AlignVCenter|AlignRight LineEdit3 Label37_2 Return AlignVCenter|AlignRight LineEdit4 LineEdit5 LineEdit6 LineEdit8 LineEdit9 ScriptObject2 LineEdit8.setText("Kommander "+_VERSION) LineEdit9.setText(Self.Item(0)) x = Self.Item(1)/Self.Item(2) return(x) ScriptObjectPHP #!/usr/bin/php <?php @LineEdit3.setText(Kommander @global(VERSION)) @LineEdit5.setText(@Self.Item(0)) echo round(@Self.Item(1)/@Self.Item(2),5) ?> Label12 5 4 0 0 Numbers to pass to scripts LineEdit7 Pass back right click on dialog for about dialog Spacer1 Horizontal Expanding 108 0 Layout1 unnamed 0 6 Spacer3 Horizontal Expanding 71 0 Label35 op 1 LineEdit1 4 0 0 0 22 Label36 / op 2 LineEdit2 4 0 0 0 7 Spacer2 Horizontal Expanding 71 0 AboutDialog1 PopupMenu1 AboutDialog1.execute 789ca598d94f1fc911c7dff7af40db6faba877a667baa747511e8c01e3030c06cc11e5a1aa7a86cbdc603051fef734f5ad9fed5d2952a4f521fba3beeaae1a7eff6de9606b63e9b7df7fb9bba7fb53599213ba5dfaad3c5c5c7cfbe7bffef1ef5f7e0d61a9fee9425e0abffeed975fb7ef976469f3ea727a013f56708dfe7a61597069b372068729f6cabbe0dcc8acbc622c4599c1a10dad72f1ca5d1370bfc77d5dcb01e70770176252de51eebb1c21df96720c6d87f51edcd3202fec5e29a7c01dee3b541e43dfa9b2ee4699dbd88e2a0f2997861a5d97040ed441dfa83c776d8ff5a3176e9b466cff6be5b6ded7aabe07ca5d37f6f4c2f400ee1bc84f1f95fb2859d7654f39a6766495c729a7b66d3a5dc77d431fa2ca2b9f9573ecb2ae975999dafa80ae5f1a0f0df6ef83fb79507bf927701e65d0f39372b507cef3837102fb2be3a1d1fd1efb4b65f87f193c3454f4fcaaf294a3e8ba6b5e3834ed88f3a528b72d352a0fef1b33e4f5df9443655d776aefd02d582e94fb568c3be3b9813ddf2a577b6695df6d1bf3a8f662514eed64fa7c521e6a38ea79867c39b48dfa9f8e95c705fb1f0c79d55f8142d7a8feee1a9cbaacfafb013c24d8c7df29f398912fee8db2c431e17d562ea137ff41be52eda9f2ca15784c05f10e7da7ba5fe5e3afc6b1d1789333f0200cff6e2acf21415f4fc643837cd5f8ace99971de6bfe756d65bc770aee52d0f8e77be550d7555efe0c4e09f1e95ae52e8c382fe7e0ae4680aeef832345e4eb2a788cd08f351fbb18b8d1fc70deb858bee1be983bc67b9aef55ba453c6d1b4b8b7a73094e7d823d37c15944f575b7ca43985ae4f7163813d6f98b71417c7bd82b6766c8ff9d8bbe479a9fdd1826e8ef173c9bfc199c02e4f167e09c08f1fb4e9916e749c0718c6a0f817e9ce70279b5fe75656c0bce6bfdeea6b1401e79569ec750903fa7c65dd1f749fdd7b75d84bd68cf3899bc1d38ce51f7b3c64f1f6a81837f37c0fdd4e9fb45e3b9efbb01f6a457c6638bf7efc07966c4eb9a721c09fef7e0347403de3b048f52501fd51ffdd091f94beb479fc75c50bfb5fef463c7886f5f8ca5457d5a07f78dc973021e479ca76cccd6dfde1897a2f92cd7df19f9f200e66e02639d3a8b57ff15cc11eb1c94b9ea83fc1fc1d4a27ffa4730e709f9a9fda697b117f873dd7886bd44fb5b5f16e759e3a79faa01105ff7604eb8af683cf573df427fd27c8c4ddfc05ea2fe8b6dead0cfbcde17bb61863fc4836998d05fb53ebdb4e309f5f69371467cb1d6c318fb8c7940b41fc594ad3e8bda230ebdc59fc3f9816982fce7606967f85bf329e6aa2fcedf1a0f93dadbad19cf13f255e3258e6326f81ffa513fb6e89fc7600a45f38b5be3cee23119cf13ea9dc67be47a5edff747e034637e21cdafda0c09eb0c798426d88b36c1dc9a7c9067ea6dde7207e03a5ea01fdc1bd714d3f31a4f351bfb80fe7e011ed3a8f672cf606a102facf1949a7ec67d740fe61efef26aff3a8d7419f553e33d853a70a1bf6b7ca5eaff84fa7c09e63a10eafe689c2dbe351f534fc4e87f9b6066cb8ff7c613e291d4be29d6fc80fe97c684fda4fd28a52a0fe6870b70951ff1a5f99e061a11ffe2c0dfe5db302e33fa81ceaf29c7087bf30c1e53863c03b8ca83fa087dc6d8e37dbf0c669970df0765926646bdd478484c05eb0c7b72f537e261c738435fdf8317e77d671c26d85ffb7d7a891f5d27e823d59ee8075a8f53a9fae2fd2be31efa5334a609fd17f217e9cc7eda4fd2944a07be06d7fbd0efcf8c05e7a9372e789fb51ea5991bab072acfd04446fcc83b6369e1ff67e3a9457e9d825313109f5bc66d40fdd1fe31b4291beb7b43a8e7f57eeac0d2c05e148c5bc48fcbc619f6259d67872ece013c82ebf8827ab307ce92d45fa4fd63e853ead01fb51e0fb1be8f7e7108ce39a1be607fa49170ff07f0c29feec27898314f6bbd1952b4fc746aef614813be47dc399832a17edc81a5b7fcb9361e511f59fd33e4dabe21df93710c88e7b7e0fa3ee4d37a338ca9833dbc185bbde1c9389abd9e8d5340fdb835ce01f322de1f47ca8807cdf781d380fa4f2b0b0e88cf2fe03aeec1deb65fac5f11e247aaffd01fb4df0ea59e473eed826b3d417d867da6349a7c37c6847ac94fc605eb04f9a76a3fdc8ff89917e769d7d8ced3155826f88f35bf7293d8d64f8ca780786fc143d3a17e1b2fdea31b63863f44e325b7f53eb59fc77dede2bc4ce04c09f6d57a9043ae21a8f2ec81ab3de0ff75b0c80c7be1fe2e31fce1ee8d05f9e4eec0436bf1cee05a2f50ff347e725fc73bc4db7be301f2b947b044f467a7f37dfd9a317b91379e218f837e491af45fa7f3681eaaff11af3a0fe43c04c4179f82c5fa0d69bdafd3fae23eed8f99eb38827eb40c9638213ebf804b67fb35de6b3a0c01f543f3af0e2f09f586b51ee56960e4a3877c53e94d9fcbef8cefd7c138ce9897609f3a3d05f8e7192cd6df58e51fdb41ccde6b6059f40fad7f6390d1ea19f6f7b9ef313fbc06978cf748eb6ffd5a0ce66f9d6fea746cf313a93feab8dbf69837b57fd66c8df6f31331ce3df245fd33723d8ff96ad378b07eba62cc33ea95c6d72839a19ed2b231c11f74042ec9eedb3266c8ef57bf33ecadf5b54ebb56df48e38b9a2c3de637adb7d48e8dfdfca50117abaf7edf58709f68fda0900bf4753be0ba8efea7f580fa3ce1e73f746e3cf78897042ec5f455fd292e5834fe285579b05ffb130d63077fc9a371847d49e7833abd14bcef3e1acf33fa81e63351b507f24feb35f1d4d8bafabf7eac36789f35bfa88cf58341d7b57ed15426bb7f024f2dce93f6a33add2e58e781fa315d2750dd1fc153b0f7745eaa5f3b61c63ca1f5f4659a34d678abd3d382757eaa5f1fc6dbf7ffffefbfb6df3b4ffa2f7bf1c54ff57fb33ffe5ffbfdb13ff1a7fecc9ffb2ffec25ffa2b7fed6ffcadbff3f7fec17ff58ffee90ffbbff967ffca2ffbd77ec5affa35ffc6affbb7fe9d7fef3ff80dbfe93ffaadc57ebfed3ff91dbfebf7fc67bfef0ffca13ff28d6f7df09def7df4c90f3efb11fb9d77ce916327aeb8c9cdeed89db85377e6cedd1777e12edd95bb76377e5cc8ef6edd9dbb770feeab7b744fee5bfdfbec5eb965f7daadb855b7e6deb875f7f6677ddd3bf7de7d701b6eb3defed16db96df7c9edb85db7e73ebb7d77e00eddd18ffdae71ad0bae73bd8b2eb9c1e55a1e3cd5982426a15207cb998e7feca7133aa5333aa72f7441977445d77443b77447f7f4405fe9919ee81b3dd3abeffb97e935add02aadd11b5aa7b7f48eded307daa04dfa485bb44d9f68877669effbfecfb44f07744847d4504b813aea2952a297196964cf8e8999e587beb5384d3cf3319ff0299ff1397fe10bbee42bbee61bbee53bbee7871ff2f3577ee427fec6cffc8a97f935aff02aaff11b5ee7b7fc8edff307dee0cd9ff67fe42ddee64fbcc3bbbcc79f799f0ff8908fea44d372e08e7bae9f873fdb9f07ae9fbfe2c509098b4891496639961339953339972f72f1f37eb9942bb9961bb9953bb99707f92a8ff224dfe4595ed513cbf2fa8ff12c2bb22a6bf246d6e52d277927efe5836cc8a67c942dd9964fb2f3a7fdbbb2279f655f0ee4508ea491568274527bb8241924cbf8e77cf1a31f8b2faed40c2b5c84e652eaffa632ffa5fcfdcfdf7ff92f64b3cec5 Form1 contextMenuRequested(int,int) PopupMenu1 popup(int,int)