Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

reverse boolean?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-31-2009, 12:48 PM
Basic4ppc Veteran
 
Join Date: Dec 2008
Posts: 203
Awards Showcase
Beta Tester 
Total Awards: 1
Default reverse boolean?

Is it possible in B4P to reverse a boolean as you can do in VB, eg:
txtTest.Visible = (bBool = False)

It would be useful as you could then reduce the code in procedures like this:

Sub ShowHidePaymentList(bShow)

If bShow = True Then
btnNewPayment.Visible = False
btnDeletePayment.Visible = False
btnClearAllP.Visible = False
btnPractices.Visible = False
btnPaymentsList.Visible = False
tblPayments.Visible = True
Else
tblPayments.Visible = False
btnNewPayment.Visible = True
btnDeletePayment.Visible = True
btnClearAllP.Visible = True
btnPractices.Visible = True
btnPaymentsList.Visible = True
End If

End Sub


RBS
Reply With Quote
  #2 (permalink)  
Old 03-31-2009, 01:09 PM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Yes

btnNewPayment.Visible = not(btnNewPayment.Visible)
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
  #3 (permalink)  
Old 03-31-2009, 03:35 PM
Basic4ppc Veteran
 
Join Date: Dec 2008
Posts: 203
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Yes, I knew that one, but it is not quite the same as reversing a "Boolean" variable. How would you code the posted procedure without the If Else
construction?

RBS
Reply With Quote
  #4 (permalink)  
Old 03-31-2009, 03:42 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Hi RB Smissaert,

I would code it like that:
Code:
Sub ShowHidePaymentList(bShow)
    tblPayments.Visible = bShow
    btnNewPayment.Visible = 
Not(bShow)
    btnDeletePayment.Visible = 
Not(bShow)
    btnClearAllP.Visible = 
Not(bShow)
    btnPractices.Visible = 
Not(bShow)
    btnPaymentsList.Visible = 
Not(bShow)
End Sub

specci48
Reply With Quote
  #5 (permalink)  
Old 03-31-2009, 03:46 PM
Basic4ppc Veteran
 
Join Date: Dec 2008
Posts: 203
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Thanks, I am nearly sure I tried that and for some reason it didn't work, but will try again tonight.

RBS
Reply With Quote
  #6 (permalink)  
Old 03-31-2009, 04:01 PM
Basic4ppc Veteran
 
Join Date: Dec 2008
Posts: 203
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Yes, that works fine.
I think I had done Not bShow as in VB.
Thanks again for clearing that up.

RBS
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional check failing for a Boolean type agraham Bug Reports 9 01-03-2008 12:22 PM


All times are GMT. The time now is 04:10 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0