New topic: 

Help please: Type mismatch error. Expected TextField but got

<http://forums.realsoftware.com/viewtopic.php?t=43779>

         Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic          Author  
Message        lenpartico          Post subject: Help please: Type mismatch 
error. Expected TextField but gotPosted: Thu Apr 26, 2012 5:12 pm               
          
Joined: Fri Sep 30, 2005 10:49 pm
Posts: 430                Hello,

Can someone explain and offer a fix?

  Dim i as integer
  
  For i = 0 to Self.ControlCount-1
  If Self.Control(i) isa TextField then
  dim MyTextField as TextField
  MyTextField = Self.Control(i)  // Error: Type mismatch error. Expected 
TextField but got Control
  end if
  next i

Thanks.

Lennox   
                             Top                DaveS          Post subject: 
Re: Help please: Type mismatch error. Expected TextField butPosted: Thu Apr 26, 
2012 5:14 pm                                 
Joined: Sun Aug 05, 2007 10:46 am
Posts: 3623
Location: San Diego, CA                MyTextField = TEXTFIELD(Self.Control(i) 
) //  you have to CAST them properly

Control is the SUPERCLASS of textfield      
_________________
Dave Sisemore
MacPro, OSX 10.7.3 RB2011r3
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top                lenpartico          Post 
subject: Re: Help please: Type mismatch error. Expected TextField butPosted: 
Thu Apr 26, 2012 5:19 pm                         
Joined: Fri Sep 30, 2005 10:49 pm
Posts: 430                Thanks Dave,

Works great, I think you might have helped me with this before and now that I 
see the solution I remembered.

Thanks again.

Lennox   
                             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]

Reply via email to