Visual Basic functions

Navigation:  Programmer developer tools > Application extension > Program source code >

Visual Basic functions

Previous pageReturn to chapter overviewNext page

This source code is found in the file Jeanie.vb

This application is Win32.NET based.

The Main issue is the strings which require the stringbuilder method the text which produces a mutable C type string.

Note this code is for static calls to the DLL. It is best to use dynamic calls as discussed in application extension.

 

Imports System.Text

Module Module1

  Public Enum MvmtType As Integer

       mtAny = 0

       mt3QHowell = 1

       mt1HalfAMitchell = 2

       mtwhist = 3

       mtAppHowell = 4

       mtAppMitchell = 5

       mtBlackpool = 6

       mtBlockMitchell = 7

       mtBowman = 8

       mtCrissCrossMitchell = 9

       mtDispMitchell = 10

       mtDoubleHesMitchell = 11

       mtDoubleHowell = 12

       mtDoubleWeaveMitchell = 13

       mtExtraBoardHowell = 14

       mtExtraBoardMitchell = 15

       mtFlowerHowell = 16

       mtHesitationBowman = 17

       mtHesitationMitchell = 18

       mtHowell = 19

       mtInterwovenHowell = 20

       mtMitchell = 21

       mtNSRover = 22

       mtRelayMitchell = 23

       mtRovertableMitchell = 24

       mtSkipMitchell = 25

       mtStaggerMitchell = 26

       mtTwinMitchells = 27

       mtUndefined = 28

       mtWebMitchell = 29

       mtiHowelltype = 30

       mtiMitchelltype = 31

       mtiIrregular = 32

       mtiCombination = 33

       mtiShomate = 34

       mtPivotMitchell = 35

       mt2TAppMitchell = 36

       mtiUser1 = 37

       mtiUser2 = 38

       mtiUser3 = 39

       mtiUser4 = 40

       mtiUser5 = 41

       mtUser1 = 42

       mtUser2 = 43

       mtUser3 = 44

       mtUser4 = 45

       mtUser5 = 46

  End Enum

 

  Public Enum MvmtClass As Integer

       mcPairs = 0

       mcIndividuals = 1

  End Enum

  Public Enum ScorerType As Integer

       stASE = 0

       stSB = 1

       stACBL = 2

  End Enum

 

 

  '************************************************

  ' All Function return a boolean result

 

  ' Main entry points to Jeanie tools

  ' ask the user to choose a movement

  Public Declare Function PickMovement Lib "JeanieComObj.dll" _

      Alias "PickMovement" (ByVal MvtClass As Integer, _

                    ByVal MvtType As Integer, _

                    ByVal Players As Integer, _

                    ByVal rounds As Integer, _

                    ByVal winners As Integer, _

                    ByRef FileNo As Integer, _

                    ByRef BrdPerSet As Integer, _

                    ByVal LibName As StringBuilder) As Boolean

 

  ' write the movement to a text file

  Public Declare Function ExportMovement Lib "JeanieComObj.dll" _

      Alias "ExportMovement" (ByVal Scorer As Integer, _

                              ByVal FileNo As Integer, _

                              ByVal LibName As StringBuilder, _

                              ByVal filename As StringBuilder) As Boolean

 

  ' get the full details of the movement

  Public Declare Function GetDetails Lib "JeanieComObj.dll" _

        Alias "GetDetails" (ByRef Tables As Integer, _

                            ByRef rounds As Integer, _

                            ByRef winners As Integer, _

                            ByRef BrdPerSet As Integer, _

                            ByRef players As Integer, _

                            ByRef Brdsets As Integer, _

                            ByRef balance As Integer, _

                            ByRef MovementType As Integer, _

                            ByRef FileNo As Integer, _

                        ByVal name As StringBuilder, _

                        ByVal MovementType As StringBuilder, _

                        ByVal Description As StringBuilder, _

                        ByVal Reference As StringBuilder, _

                        ByVal page As StringBuilder, _

                        ByVal MII As StringBuilder, _

                        ByVal LibName As StringBuilder) As Boolean

 

  '************************************************

  ' Other entry points to Jeanie tools

  ' In iteration use 'first' then 'next' until false returned followed by 'Close'

 

  ' Iterate through the libraries

  Public Declare Function GetFirstLib Lib "JeanieComObj.dll" _

    Alias "GetFirstLib" _

           (ByVal LibName As StringBuilder) As Boolean

 

  Public Declare Function GetNexttLib Lib "JeanieComObj.dll" _

      Alias "GetNexttLib" _

           (ByVal LibName As StringBuilder) As Boolean

 

  Public Declare Function GetLibClose Lib "JeanieComObj.dll" _

    Alias "GetLibClose" () As Boolean

 

  ' Iterate through the movements

  Public Declare Function GetFirstMvt Lib "JeanieComObj.dll" _

    Alias "GetFirstMvt" (ByVal MvtClass As Integer, _

                    ByVal Tables As Integer, _

                    ByVal Players As Integer, _

                    ByVal rounds As Integer, _

                    ByVal winners As Integer, _

                    ByVal balance As Integer, _

                    ByVal MovementType As Integer, _

                    ByRef FileNo As Integer, _

                    ByVal LibName As StringBuilder) As Boolean

 

  Public Declare Function GetNextMvt Lib "JeanieComObj.dll" _

    Alias "GetNextMvt" (ByRef FileNo As Integer) As Boolean

 

  Public Declare Function GetMvtClose Lib "JeanieComObj.dll" _

    Alias "GetMvtClose" () As Boolean

 

  ' get the details from the index file - basic information

  Public Declare Function GetDisplay Lib "JeanieComObj.dll" _

      Alias "GetDisplay" (ByRef Tables As Integer, _

                  ByRef rounds As Integer, _

                  ByRef winners As Integer, _

                  ByRef players As Integer, _

                  ByRef balance As Integer, _

                  ByRef Sets As Integer, _

                  ByRef MovementType As Integer, _

                  ByRef FileNo As Integer, _

                  ByVal name As StringBuilder, _

                  ByVal Reference As StringBuilder, _

                  ByVal page As StringBuilder) As Boolean

 

  ' load up the names of the movements for the class in use

  ' so the 'GetMovementName' will work

 

  Public Declare Function LoadMovementText Lib "JeanieComObj.dll" _

    Alias "LoadMovementText" _

   (ByVal MvtClass As Integer) As Boolean

 

 

  ' unload before load is used - just to tidy up

  Public Declare Function UnLoadMovementText Lib "JeanieComObj.dll" _

    Alias "UnLoadMovementText" () As Boolean

 

  ' Give me the movement name

  Public Declare Function GetMovementName Lib "JeanieComObj.dll" _

    Alias "GetMovementName" (ByRef mvtIdx As Integer, _

                              ByVal MvtName As StringBuilder) As Boolean

 

End Module