New topic: 

Port function to realbasic

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

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        diego2k          Post subject: Port function to realbasicPosted: 
Mon Jun 14, 2010 4:03 pm                         
Joined: Fri Nov 23, 2007 9:27 am
Posts: 35
Location: Rosario, Argentina                Hi guys, i need to port this VB6 
function to realbasic:

Code:Function isPFiscalOk(comando As Integer) As Integer
Dim status_print As Double
Dim status_fiscal As Double
Dim and_mask As Double

status_print = Val("&H" + Trim(garrayentrada(1)))
status_fiscal = Val("&H" + Trim(garrayentrada(2)))

'Test bit #15
and_mask = 2 ^ 15

isPFiscalOk = IIf((status_print And and_mask) Or (status_fiscal And and_mask) = 
0, True, False)

End Function


I do the follow: 

Code:  Dim status_print As Double
  Dim status_fiscal As Double
  Dim and_mask As Double
  
  status_print = cDbl("&H" + Trim(garrayentrada(1)))
  status_fiscal = cDbl("&H" + Trim(garrayentrada(2)))
  
  'To Test the #15 bit
  and_mask = 2 ^ 15
  
  return IIf((status_print And and_mask) Or (status_fiscal And and_mask) = 0, 
True, False)


but i get the following compile error:

Error type correspondence.
Boolean was expected, but got Double,
return IIf((status_print And and_mask) Or (status_fiscal And and_mask) = 0, 
True, False)   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
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