<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic When you enter a post, there in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/waitonmouseevent/m-p/1060697#M117450</link>
    <description>&lt;P&gt;When you enter a post, there is a row of buttons for various formatting options. The second from the right is the Code button. Click that, select Fortran from the dropdown, and paste your code into that.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Jan 2015 20:43:09 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2015-01-29T20:43:09Z</dc:date>
    <item>
      <title>waitonmouseevent</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/waitonmouseevent/m-p/1060692#M117445</link>
      <description>I am trying to understand the following sample code from the on-line documentation.
When compiled as a Quick Win program it runs. Can someone please explain the code?

INTEGER(4) mouseevent, keystate, x, y
mouseevent = MOUSE$RBUTTONDOWN .OR. MOUSE$LBUTTONDOWN
result = WAITONMOUSEEVENT (mouseevent, keystate, x , y)

if ((MOUSE$KS_SHIFT .AND. keystate) == MOUSE$KS_SHIFT) then
  write (*,*) 'Shift key was down'
endif

if ((MOUSE$KS_CONTROL .AND. keystate) == MOUSE$KS_CONTROL) then
  write (*,*) 'Ctrl key was down'
endif

1) Please explain:   mouseevent = MOUSE$RBUTTONDOWN .OR. MOUSE$LBUTTONDOWN  
i.e. what does it mean to .OR. two symbolic constants and set that equal to mouseevent which is INTEGER(4). And how does that work?

2)How are the tests in the IF statements made?

Thank you.</description>
      <pubDate>Thu, 29 Jan 2015 04:00:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/waitonmouseevent/m-p/1060692#M117445</guid>
      <dc:creator>Robert</dc:creator>
      <dc:date>2015-01-29T04:00:22Z</dc:date>
    </item>
    <item>
      <title>This example has so much</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/waitonmouseevent/m-p/1060693#M117446</link>
      <description>&lt;P&gt;This example has so much wrong with it I hardly know where to start. The misuse of logical operations on integers, which we support as an extension, is the least of it. There are numerous syntax errors as well. I will have it replaced.&lt;/P&gt;

&lt;P&gt;Basically, the .OR. should be replaced with references to the IOR intrinsic and the .AND. replaced with IAND.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2015 15:21:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/waitonmouseevent/m-p/1060693#M117446</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-01-29T15:21:26Z</dc:date>
    </item>
    <item>
      <title>This is what it should be:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/waitonmouseevent/m-p/1060694#M117447</link>
      <description>&lt;P&gt;This is what it should be:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;   USE IFQWIN
   INTEGER(4) mouseevent, keystate, x, y, result
   !...
   mouseevent = IOR(MOUSE$RBUTTONDOWN,MOUSE$LBUTTONDOWN)
   result = WAITONMOUSEEVENT (mouseevent, keystate, x , y)
 !
 ! Wait until right or left mouse button clicked, then check the keystate
 ! with the following:
 !
   if (IAND(MOUSE$KS_SHIFT,keystate) == MOUSE$KS_SHIFT)       &amp;amp;
  &amp;amp; write (*,*) 'Shift key was down'
   if (IAND(MOUSE$KS_CONTROL,keystate) == MOUSE$KS_CONTROL)   &amp;amp;
  &amp;amp; write (*,*) 'Ctrl key was down'
  end&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2015 15:23:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/waitonmouseevent/m-p/1060694#M117447</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-01-29T15:23:51Z</dc:date>
    </item>
    <item>
      <title>When Fortran was the only</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/waitonmouseevent/m-p/1060695#M117448</link>
      <description>&lt;P&gt;When Fortran was the only language I knew, I remember that reading about logical and shift operations (in the machine language sense, not the high level language sense) was a revelation to me. Instead of thinking about an INTEGER variable as a number having a value, you can think of it as an array of BIT_SIZE(I) logical values, or flags. Same variables, just different way to think about them.&lt;/P&gt;

&lt;P&gt;ORing two integer variables results in a variable whose set flags are the union of the set flags of the inputs. For two inputs IOR(A,B) achieves this. For any number of inputs, f2008 provides IANY([A,B,C,D]) (as an example with 4 inputs).&lt;/P&gt;

&lt;P&gt;ANDing two integer variables results in a variable whose set flags are the intersection of the set flags of the inputs. For two inputs use IAND(A,B); for any number of inputs, IALL([A,B,C,D]).&lt;/P&gt;

&lt;P&gt;There is also IEOR(A,B) to toggle bits, IPARITY for any number of inputs.&lt;/P&gt;

&lt;P&gt;Thus in the above, MOUSE$RBUTTONDOWN and MOUSE$LBUTTONDOWN each have, I assume, 1 bit (flag) set in them so the WAITONMOUSEEVENT invocation ends up checking for both events because those are the two flags that are set in mouseevent. IAND(MOUSE$KS_SHIFT,keystate) will equal MOUSE$KS_SHIFT exactly when all the bits (flags) that are set in MOUSE$KS_SHIFT are also set in keystate.&lt;/P&gt;

&lt;P&gt;So this way of thinking about integer variables is sort of a set of logical operations on a fixed size array. A Possible reference is &lt;A href="http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=3&amp;amp;ved=0CCwQFjAC&amp;amp;url=http%3A%2F%2Fwww.cs.uwm.edu%2Fclasses%2Fcs215%2Fslides%2F14%2520-%2520Arithmetic%2520%26%2520Logic%25201.ppt&amp;amp;ei=81TKVPS4MJe2yASYuIGgDA&amp;amp;usg=AFQjCNGOT8mICel1yne6WHk8aWDQRh-stQ&amp;amp;bvm=bv.84607526,d.aWw"&gt;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=3&amp;amp;ved=0CCwQFjAC&amp;amp;url=http%3A%2F%2Fwww.cs.uwm.edu%2Fclasses%2Fcs215%2Fslides%2F14%2520-%2520Arithmetic%2520%26%2520Logic%25201.ppt&amp;amp;ei=81TKVPS4MJe2yASYuIGgDA&amp;amp;usg=AFQjCNGOT8mICel1yne6WHk8aWDQRh-stQ&amp;amp;bvm=bv.84607526,d.aWw&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2015 16:21:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/waitonmouseevent/m-p/1060695#M117448</guid>
      <dc:creator>JVanB</dc:creator>
      <dc:date>2015-01-29T16:21:07Z</dc:date>
    </item>
    <item>
      <title>Steve and Repeat Offender:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/waitonmouseevent/m-p/1060696#M117449</link>
      <description>&lt;P&gt;Steve and Repeat Offender:&lt;/P&gt;

&lt;P&gt;Thank you for the replies. They are very helpful and fully explain everything.&lt;/P&gt;

&lt;P&gt;By the way is there a document that gives tips on how to format posts to the forum? &amp;nbsp;I would like to know how Steve inserted his code snip into his post, and how to start a new line without inserting a blank line (like the blank line between the lines Regards and Bob below).&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;Bob.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2015 20:13:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/waitonmouseevent/m-p/1060696#M117449</guid>
      <dc:creator>Robert</dc:creator>
      <dc:date>2015-01-29T20:13:36Z</dc:date>
    </item>
    <item>
      <title>When you enter a post, there</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/waitonmouseevent/m-p/1060697#M117450</link>
      <description>&lt;P&gt;When you enter a post, there is a row of buttons for various formatting options. The second from the right is the Code button. Click that, select Fortran from the dropdown, and paste your code into that.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2015 20:43:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/waitonmouseevent/m-p/1060697#M117450</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-01-29T20:43:09Z</dc:date>
    </item>
  </channel>
</rss>

