LoneWolf_2106 Posted December 14, 2017 Share Posted December 14, 2017 Hi everybody, maybe it is a stupid question, is it possible to filter the values in a MsgBox? I have some some values dynamically generated, sometimes it might happen that one of them is basically null and i don't want to "print" it together with the others. Is it possible to add some Kind of filter or if to a Msgbox? Link to comment Share on other sites More sharing options...
kylomas Posted December 14, 2017 Share Posted December 14, 2017 LoneWolf_2106, Yes, in your code on line... Post some code, please. kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
LoneWolf_2106 Posted December 14, 2017 Author Share Posted December 14, 2017 MsgBox(0,"Daten ermittelt","Daten des Onlineupdates:"&@CRLF&"Heute: "&$datumheute&@CRLF&" Aufrufe gesamt(Update Requests+Error): "&$anzahl_info_heute+$anzahl_error_heute& _ @CRLF&@TAB&"Update Requests: "&$anzahl_info_heute& _ @CRLF&@TAB&"Error: "&$anzahl_error_heute& _ @CRLF&@TAB&"Parsing client dictionary failed: "&$anzahl_heute_info_parsing_failed& _ @CRLF&"client version: 5.2.00_01.01.2016 server version: 5.2.24_28.11.2017 :"&$Counter_MDU_5200&@TAB&"("&$Prozent_MDU_5200&"%)"& _ @CRLF&"client version: 5.2.11_31.08.2010 server version: 5.2.24_28.11.2017 :"&$Counter_MDU_5211_31082010&@TAB&"("&$Prozent_MDU_5211_31082010&"%)"& _ @CRLF&"client version: 5.2.11_01.01.2017 server version: 5.2.24_28.11.2017 :"&$Counter_MDU_5211_01012017&@TAB&"("&$Prozent_MDU_5211_01012017&"%)"& _ @CRLF&"client version: 5.2.18_18.08.2017 server version: 5.2.24_28.11.2017 :"&$Counter_MDU_5218_18082017&@TAB&"("&$Prozent_MDU_5218_18082017&"%)"& _ @CRLF&"client version: 5.2.18_11.09.2017 server version: 5.2.24_28.11.2017 :"&$Counter_MDU_5218_11092017&@TAB&"("&$Prozent_MDU_5218_11092017&"%)"& _ @CRLF&"client version: 5.2.18_04.10.2017 server version: 5.2.24_28.11.2017 :"&$Counter_MDU_5218_04102017&@TAB&"("&$Prozent_MDU_5218_04102017&"%)"& _ @CRLF&"client version: 5.2.21_09.10.2017 server version: 5.2.24_28.11.2017 :"&$Counter_MDU_5221_09102017&@TAB&"("&$Prozent_MDU_5221_09102017&"%)"& _ @CRLF&"client version: 5.2.21_23.10.2017 server version: 5.2.24_28.11.2017 :"&$Counter_MDU_5221_23102017&@TAB&"("&$Prozent_MDU_5221_23102017&"%)"& _ @CRLF&"client version: 5.2.21_27.10.2017 server version: 5.2.24_28.11.2017 :"&$Counter_MDU_5221_27102017&@TAB&"("&$Prozent_MDU_5221_27102017&"%)"& _ @CRLF&"client version: 5.2.21_14.11.2017 server version: 5.2.24_28.11.2017 :"&$Counter_MDU_5221_14112017&@TAB&"("&$Prozent_MDU_5221_14112017&"%)"& _ @CRLF&"client version: 5.2.21_23.11.2017 server version: 5.2.24_28.11.2017 :"&$Counter_MDU_5221_23112017&@TAB&"("&$Prozent_MDU_5221_23112017&"%)"& _ @CRLF&"client version: 5.2.21_28.11.2017 server version: 5.2.24_28.11.2017 :"&$Counter_MDU_5221_28112017&@TAB&"("&$Prozent_MDU_5221_28112017&"%)"& _ @CRLF&"client version: 5.2.21_13.12.2017 server version: 5.2.24_28.11.2017 :"&$Counter_MDU_5221_13122017&@TAB&"("&$Prozent_MDU_5221_13122017&"%)"& _ @CRLF&"client version: 5.2.22_11.11.2017 server version: 5.2.24_28.11.2017 :"&$Counter_MDU_5222_11112017&@TAB&"("&$Prozent_MDU_5222_11112017&"%)") This is my MsgBox and not all the counters have a value greater than 0 Link to comment Share on other sites More sharing options...
kylomas Posted December 14, 2017 Share Posted December 14, 2017 Lonewolf_2016, You will need to construct the string outside of the message box testing for values to include...like Local $str = '', $c1 = 1, $c2 = 0, $c3 = 9 If $c1 > 0 Then $str &= 'Some text and counter = ' & $c1 & @CRLF If $c2 > 0 Then $str &= 'Some text2 and counter2 = ' & $c2 & @CRLF If $c3 > 0 Then $str &= 'Some text3 and counter3 = ' & $c3 & @CRLF MsgBox(0, 'TEXT', $str) kylomas Earthshine 1 Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Malkey Posted December 14, 2017 Share Posted December 14, 2017 This will work also. Local $str = '', $c1 = -1, $c2 = 0, $c3 = 9 ; Using Conditional operator (?:) See: "Language Reference - Operators", or, the "Ternary operator" in AutoIt help file. MsgBox(0, 'TEXT', _ ($c1 ? 'Some text and counter1 = ' & $c1 & @CRLF : '') & _ ($c2 ? 'Some text2 and counter2 = ' & $c2 & @CRLF : '') & _ ; Zero is false. Not zero is true. ($c3 ? 'Some text3 and counter3 = ' & $c3 & @CRLF : '')) Earthshine 1 Link to comment Share on other sites More sharing options...
mikell Posted December 14, 2017 Share Posted December 14, 2017 As the OP mentioned "a value greater than 0 " this could be more accurate ($c1>0 ? 'Some text and counter1 = ' & $c1 & @CRLF : '') & _ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now