kwibus Posted February 3, 2016 Share Posted February 3, 2016 Hello, I am very new to AutoIt, just started learning a few days ago. On the forum I am trying to find how the mentioned GUI calculator can be amended, and made to work. Yesterday I thought I found something, but I was tired and did not write down where I found it. Now, today, I can not find the topic again, unfortunately. Can someone tip me where to find, and how to search better on the forum. I really want to learn more by studying and trying the examples, on a beginner level. Thank you, Ad R. Link to comment Share on other sites More sharing options...
TheDcoder Posted February 3, 2016 Share Posted February 3, 2016 Google "site:autoitscript.com <Insert your search term here>" EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
Jfish Posted February 3, 2016 Share Posted February 3, 2016 Not sure if this is what you mean but in the help file there is a tutorial section. One topic is "Simple Calculator GUI". Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
kwibus Posted February 3, 2016 Author Share Posted February 3, 2016 22 minutes ago, Jfish said: Not sure if this is what you mean but in the help file there is a tutorial section. One topic is "Simple Calculator GUI". Yes, but that is only the code to create the GUI dialog. What I am searching for, is code to make it actually work; I have seen the names "guinness" and "Azjio" mentioned, but, as I wrote, I can not locate this again. I am probably stupid, not knowing exactly how to search the forums. Link to comment Share on other sites More sharing options...
TheDcoder Posted February 3, 2016 Share Posted February 3, 2016 If you want to create a window, you can use GUICreate... Or use Koda which comes with the full installation of SciTE4AutoIt EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
orbs Posted February 3, 2016 Share Posted February 3, 2016 (edited) @kwibus, welcome to AutoIt and to the forum. why won't you try it yourself? copying others' solutions will not improve your skills like doing it on your own. i advise you study the examples for various GUI functions, like GUICReate, GUIGetMsg, etc. once you understand those, it becomes easier to complete the functionality of the calculator. EDIT: changed AutoIT to AutoIt - thanks to TheDcoder for the post hereunder. Edited February 3, 2016 by orbs kwibus 1 Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
TheDcoder Posted February 3, 2016 Share Posted February 3, 2016 1 minute ago, orbs said: AutoIT Its AutoIt EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
kwibus Posted February 3, 2016 Author Share Posted February 3, 2016 43 minutes ago, Jfish said: I like orbs reply; he is right. That is exactly the advice I would give. Link to comment Share on other sites More sharing options...
Jfish Posted February 3, 2016 Share Posted February 3, 2016 @kwibus - I did not say that ... please don't misquote. If that is what you think then claim attribution for yourself. 1 hour ago, Jfish said: I like orbs reply; he is right. That is exactly the advice I would give. Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
kwibus Posted February 3, 2016 Author Share Posted February 3, 2016 6 minutes ago, Jfish said: @kwibus - I did not say that ... please don't misquote. If that is what you think then claim attribution for yourself. I like orbs reply; he is right. That is exactly the advice I would give. @Jfish I am sorry; I wanted to reply to orb, but your message was quoted. Link to comment Share on other sites More sharing options...
kylomas Posted February 3, 2016 Share Posted February 3, 2016 A search for "calculator" resulted in 1600+ hits...I'm sure one of them has something you can use. 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...
kwibus Posted February 3, 2016 Author Share Posted February 3, 2016 6 hours ago, Jfish said: @kwibus - I did not say that ... please don't misquote. If that is what you think then claim attribution for yourself. I like orbs reply; he is right. That is exactly the advice I would give. @Jfish I am sorry; I wanted to reply to orb, but your message was quoted. Link to comment Share on other sites More sharing options...
kwibus Posted February 3, 2016 Author Share Posted February 3, 2016 Hi, Everybody, thanks for helping me. Now I have a more specific question, about these lines of code: If StringInStr($i_EdtScreen, '.') = 0 Then GUICtrlSetData($i_EdtScreen, '.', 1) EndIf The idea behind this: in case a button is clicked, to insert a period in a number, only one period is valid to build a real number. So, if there is already a period in the input edit screen, there should not be a period added. I hope you understand what I mean. But the code above allows a second, third etc. period added. What am I doing wrong? Link to comment Share on other sites More sharing options...
kwibus Posted February 3, 2016 Author Share Posted February 3, 2016 Hi, I see, I should post code like this: If StringInStr($i_EdtScreen, '.') = 0 Then GUICtrlSetData($i_EdtScreen, '.', 1) EndIf Thank you, Ad Link to comment Share on other sites More sharing options...
kylomas Posted February 4, 2016 Share Posted February 4, 2016 Kwibus, You are missing the guictrlread in the stringinstr test...on stupid phone and cant type very well... 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...
kwibus Posted February 4, 2016 Author Share Posted February 4, 2016 11 minutes ago, kylomas said: Kwibus, You are missing the guictrlread in the stringinstr test...on stupid phone and cant type very well... Kylomas Yes! Thank you, @kylomas This the solution: $i_text = GUICtrlRead($i_EdtScreen) If StringInStr($i_text, '.') = 0 Then GUICtrlSetData($i_EdtScreen, '.', 1) Thank you again, now I have got more knowledge to get further! Ad Link to comment Share on other sites More sharing options...
kwibus Posted February 4, 2016 Author Share Posted February 4, 2016 (edited) Hello again, I have a new question about something I don't understand. It is about Ternary Conditionally chooses one of two responses based on the result of an expression. the code: (StringLeft($sVar, 1) == '-') ? ($sVar = StringTrimLeft($sVar, 1)) : ($sVar = '-' & $sVar) this gives me an error: Statement cannot be just an expression. I really do not understand this error message; what is wrong with my code? Could it be that the responses can only be strings, string literals? Thank you, Ad Edited February 4, 2016 by kwibus another idea Link to comment Share on other sites More sharing options...
kylomas Posted February 4, 2016 Share Posted February 4, 2016 kwibus, Try this... $sVar = (StringLeft($sVar, 1) == '-') ? StringTrimLeft($sVar, 1)) : $sVar = '-' & $sVar 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...
kwibus Posted February 4, 2016 Author Share Posted February 4, 2016 5 minutes ago, kylomas said: kwibus, Try this... $sVar = (StringLeft($sVar, 1) == '-') ? StringTrimLeft($sVar, 1)) : $sVar = '-' & $sVar kylomas @kylomas: Yes, this is a good solution, thank you. Only the : expression returns 'false' instead of a negative number. My solution: $sVar = (StringLeft($sVar, 1) = '-') ? (StringTrimLeft($sVar, 1)) : ('-' & $sVar) Ad Link to comment Share on other sites More sharing options...
kylomas Posted February 4, 2016 Share Posted February 4, 2016 (edited) kwibus, Cool, was just showing you the form that the stmt should take...perhaps I should have stated that. kylomas P.S. Pun intended... Edited February 4, 2016 by 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...
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