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
    Blog Entries
    Rep Power
    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
    ' 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: Windows 11 Enterprise x64 Build 22065 (21H2 pre-release)
    (says the systeminfo. anything else says it were Windows 10 - more or less insider - a lot of the system settings do not function - i could imagine it will not send feedback to microsoft since it always says i need a new app to open that feedback-hub-link. But hey: thinbasic runs well )

  2. #12
    Join Date
    Aug 2015
    Keralam, India
    Rep Power
    @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
    Brno - Czech Republic
    Blog Entries
    Rep Power

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

    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