Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: How to bit shift in ThinBasic ?

  1. #11
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    51
    Posts
    1,422
    Blog Entries
    1
    Rep Power
    157
    Private and Public are working bit different as in .net

    You will use it within type/end type to grant local or global access to the properties or methods of a type but not write it in front of everything but acting as a switch.
    Its like
    Type tExample
    
    'Public '(default setting / not needed here)
    X As Double
    Y As Double
    Z as Double
    
    Private  ' <<< all that follows until "Public" or "End Type" is from now private
    
    A As Long
    B As Long
    
    Function DoSomethingPrivate()
    
    End Function
    
    Public  ' <<< switch to end private scope
    
    Function DoSomethingPublic(ByRef lA As Long, ByRef lB as Long ) 
    ' here accessing Me.A or Me.B is possible
    Me.A= lB - lA
    Me.B = lB + lA
     since keyword "Me" signals a reference of tExample is accessing 
    ' its own data only while 
    
    lA = Me.A
    lB = Me.B
    
    ' were an illegal exploit since that would not obey the rules of privacy 
    ' because its not only giving direct access to the variables but also 
    ' tells theirs position in memory. Would lead to runtime error
    
    end function
    
    end type
    
    Private 
    ' can not be private outside of type declarations
    

    Am not sure if completely developed yet but if your code follows the rules
    it will be compatible
    running thinBasic in HP Pavillon Desktop 590 a0xxx 8GB Ram AMD A6-9225 Radeon R4 5Compute Cores 2C+3G @2.6GHz

    OS: downgraded again to Windows 10 Enterprise x64 10.0.18363 Build 18363 (1909)
    (alternate OS: modified WinRE - boot from a fake ramdisk - currently in "reconstruction mode")

  2. #12
    Member
    Join Date
    Aug 2015
    Location
    Keralam, India
    Posts
    120
    Rep Power
    18
    @Rene Miner,
    Am not sure if completely developed yet
    I think that's the reason. Currently, "Private" is making no difference.

  3. #13
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,089
    Blog Entries
    5
    Rep Power
    725
    Hi,

    private / public are reserved keywords, but they have no effect at the moment.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Is there a bit-shift function?
    By ISAWHIM in forum thinBasic General
    Replies: 18
    Last Post: 29-09-2008, 17:05
  2. For SHIFT keyword
    By ErosOlmi in forum Samples for help file
    Replies: 0
    Last Post: 26-05-2007, 10:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •