New topic: something strange in the if
<http://forums.realsoftware.com/viewtopic.php?t=46875> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message jetpr Post subject: something strange in the ifPosted: Fri Feb 08, 2013 12:36 pm Joined: Wed Sep 20, 2006 5:12 pm Posts: 588 Location: Puerto Rico if (Asc(key)=13) or (Asc(key)=03) and (TxtUserId.Text="0000") then <<< this no Works way RS2012r2.1 FrmEmployee.Close FrmCal.ShowModal Else If (ASC(Key)=13) or (Asc(key)=03) then GetEmployee(TxtUserId.Text) End If end if _________________ Thanks for any contribution and God blesses all (I start Using RS in 10/12/2010) Mac Mini with Snow Leopard v10.6.8 and Real Studio 2012r1 Pro And Windows 7 RS2012r1 Personal and Linux RS2012r1 Personal Register user my Hobbies R/C Turbines Jets Models Top DaveS Post subject: Re: something strange in the ifPosted: Fri Feb 08, 2013 1:05 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 4510 Location: San Diego, CA You must properly segregate AND / OR conditions in your IF / THEN statement IF ( Asc(key)=13 Or Asc(key)=03) ) And TxtUserId.Text="0000" Then please note the () which have had their position changed And here is a better way to do it. check the key ONE time if Asc(key)=13 or Asc(key)=03 then if TxtUserId.Text="0000" then FrmEmployee.Close FrmCal.ShowModal Else GetEmployee(TxtUserId.Text) End If ' end text check End If ' end key check _________________ Dave Sisemore MacPro, OSX Lion 10.7.4 RB2012r1 Note : I am not interested in any solutions that involve custom Plug-ins of any kind Last edited by DaveS on Fri Feb 08, 2013 1:07 pm, edited 1 time in total. Top jetpr Post subject: Re: something strange in the ifPosted: Fri Feb 08, 2013 1:06 pm Joined: Wed Sep 20, 2006 5:12 pm Posts: 588 Location: Puerto Rico ok thanks _________________ Thanks for any contribution and God blesses all (I start Using RS in 10/12/2010) Mac Mini with Snow Leopard v10.6.8 and Real Studio 2012r1 Pro And Windows 7 RS2012r1 Personal and Linux RS2012r1 Personal Register user my Hobbies R/C Turbines Jets Models Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
