Skip to content

Commit

Permalink
Auto-sync on 2025/02/09 06:18:53
Browse files Browse the repository at this point in the history
2025/02/08
    Remove some unused parameters and procedures.
  • Loading branch information
actions committed Feb 9, 2025
1 parent 5db1218 commit e65f002
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 308 deletions.
2 changes: 1 addition & 1 deletion calczaf.vbp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Description="Standalone ZAF/Phi-Rho-Z Calculator"
CompatibleMode="0"
MajorVer=14
MinorVer=0
RevisionVer=1
RevisionVer=2
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="Probe Software, Inc"
Expand Down
2 changes: 1 addition & 1 deletion calmac.vbp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Description="Mass Absorption Coefficient Calculator"
CompatibleMode="0"
MajorVer=14
MinorVer=0
RevisionVer=1
RevisionVer=2
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="Probe Software, Inc"
Expand Down
4 changes: 0 additions & 4 deletions convert.bas
Original file line number Diff line number Diff line change
Expand Up @@ -1182,8 +1182,6 @@ Sub ConvertFerrousFerricRatioFromComposition(nelements As Integer, AtomicNumbers
ierror = False
On Error GoTo ConvertFerrousFerricRatioFromCompositionError

Const FeO_to_Fe2O3! = 1.11134

Dim ip As Integer
Dim n As Integer

Expand Down Expand Up @@ -1362,8 +1360,6 @@ Sub ConvertFerrousFerricRatioFromComposition2(nelements As Integer, AtomicNumber
ierror = False
On Error GoTo ConvertFerrousFerricRatioFromComposition2Error

Const FeO_to_Fe2O3! = 1.11134

Dim ip As Integer
Dim n As Integer

Expand Down
2 changes: 1 addition & 1 deletion excel.bas
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Option Explicit
' FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
' IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Private Const ERR_EXCEL_NOTRUNNING& = 429
'Private Const ERR_EXCEL_NOTRUNNING& = 429

' Declare necessary API routines:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As Long) As Long
Expand Down
42 changes: 20 additions & 22 deletions global.bas
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Global Const MICRONSPERCM& = 10000 ' microns per centimeter
Global Const MICRONSPERMM& = 1000 ' microns per millimeter

Global Const ANGPERNM& = 10 ' angstroms per nanometer
Global Const NMPERANG# = 0.1 ' nanometers per angstrom
'Global Const NMPERANG# = 0.1 ' nanometers per angstrom

Global Const CMPERANGSTROM# = 0.00000001 ' centi-meters per angstrom

Expand All @@ -163,14 +163,14 @@ Global Const NAPA# = 1000000000# ' nano-amps per amp
Global Const APNA# = 0.000000001 ' amps per nano-amps
Global Const PAPA# = 1000000000000# ' pico-amps per amp
Global Const PAPERNA# = 1000# ' pico-amps per nano-amp
Global Const NAPERMA# = 1000# ' nano-amps per milli-amp
Global Const NAPERMA# = 1000# ' nano-amps per micro-amp

Global Const ANGKEV! = 12.39854 ' angstrom per KeV (and visa versa)
Global Const ANGEV! = 12398.54 ' angstrom per eV (and visa versa)
Global Const EVPERKEV# = 1000# ' eV per keV
Global Const MILLIVOLTPERVOLT# = 1000# ' millivolt per volt

Global Const MICROSECPERMILLSEC& = 1000# ' micro-secs per milli-sec
'Global Const MICROSECPERMILLSEC& = 1000# ' micro-secs per milli-sec
Global Const MSPS! = 1000000# ' micro-secs per second
Global Const TENTHMSECPERSEC# = 10000# ' 1/10th millsecs per second
Global Const MSECPERSEC# = 1000# ' milli-seconds per second
Expand Down Expand Up @@ -249,22 +249,22 @@ Global Const BIT3& = 7 ' maximum 3 bit depth 0-7
Global Const BIT2& = 3 ' maximum 2 bit depth 0-3
Global Const BIT1& = 1 ' maximum 1 bit depth 0-1

Global Const SIZE_65536_BYTES& = 65536 ' 65536 byte constant
Global Const SIZE_32768_BYTES& = 32768 ' 32768 byte constant
Global Const SIZE_16384_BYTES& = 16384 ' 16384 byte constant
Global Const SIZE_8192_BYTES& = 8192 ' 8192 byte constant
Global Const SIZE_4096_BYTES& = 4096 ' 4096 byte constant
Global Const SIZE_2048_BYTES& = 2048 ' 2048 byte constant
Global Const SIZE_1024_BYTES& = 1024 ' 1024 byte constant
Global Const SIZE_512_BYTES& = 512 ' 512 byte constant
Global Const SIZE_256_BYTES& = 256 ' 256 byte constant
Global Const SIZE_128_BYTES& = 128 ' 128 byte constant
Global Const SIZE_64_BYTES& = 64 ' 64 byte constant
Global Const SIZE_32_BYTES& = 32 ' 32 byte constant
Global Const SIZE_16_BYTES& = 16 ' 16 byte constant
Global Const SIZE_8_BYTES& = 8 ' 8 byte constant
Global Const SIZE_4_BYTES& = 4 ' 4 byte constant
Global Const SIZE_2_BYTES& = 2 ' 2 byte constant
'Global Const SIZE_65536_BYTES& = 65536 ' 65536 byte constant
'Global Const SIZE_32768_BYTES& = 32768 ' 32768 byte constant
'Global Const SIZE_16384_BYTES& = 16384 ' 16384 byte constant
'Global Const SIZE_8192_BYTES& = 8192 ' 8192 byte constant
'Global Const SIZE_4096_BYTES& = 4096 ' 4096 byte constant
'Global Const SIZE_2048_BYTES& = 2048 ' 2048 byte constant
'Global Const SIZE_1024_BYTES& = 1024 ' 1024 byte constant
'Global Const SIZE_512_BYTES& = 512 ' 512 byte constant
'Global Const SIZE_256_BYTES& = 256 ' 256 byte constant
'Global Const SIZE_128_BYTES& = 128 ' 128 byte constant
'Global Const SIZE_64_BYTES& = 64 ' 64 byte constant
'Global Const SIZE_32_BYTES& = 32 ' 32 byte constant
'Global Const SIZE_16_BYTES& = 16 ' 16 byte constant
'Global Const SIZE_8_BYTES& = 8 ' 8 byte constant
'Global Const SIZE_4_BYTES& = 4 ' 4 byte constant
'Global Const SIZE_2_BYTES& = 2 ' 2 byte constant

Global Const IMAGESIZE128& = 128 ' image size 128 x 128 (96 @ 4/3)
Global Const IMAGESIZE256& = 256 ' image size 256 x 256 (192 @ 4/3)
Expand Down Expand Up @@ -345,13 +345,12 @@ Global Const MAXCRITERIA% = 3 ' dynamic element criteria for CalcImag
Global Const LOTSOFGRIDPOINTS% = 1000 ' lots of polygon points (hide FormAUTOMATE)
Global Const TOOMANYGRIDSTEPS% = 2000 ' too many grid steps
Global Const MAXTITLELENGTH% = 80 ' maximum graph title length
Global Const MAX_PATH% = 259 ' maximum file and path length for Dir$ command

Global Const FONT_REGULAR% = 0 ' regular format
Global Const FONT_BOLD% = 1 ' bold
Global Const FONT_ITALIC% = 2 ' italic
Global Const FONT_UNDERLINE% = 4 ' underline
Global Const FONT_STRIKETHRU% = 8 ' strikethru
'Global Const FONT_STRIKETHRU% = 8 ' strikethru

' Database Field lengths
Global Const DbTextDescriptionLength% = 255
Expand Down Expand Up @@ -1405,7 +1404,6 @@ Global Const OutputDataFileNumber% = 124 ' OutputDataFile$ (*.OUT)

Global Const Temp1FileNumber% = 125 ' temporary file I/O
Global Const Temp2FileNumber% = 126 ' temporary file I/O
Global Const CustomOutputFileNumber% = 200 ' #200-255 Custom format analysis output files

' Database access flags
Global DatabaseExclusiveAccess As Integer ' for generic exclusive access
Expand Down
193 changes: 0 additions & 193 deletions misc.bas
Original file line number Diff line number Diff line change
Expand Up @@ -156,81 +156,6 @@ Exit Function

End Function

Function IPOS3(ByVal n As Integer, ByVal temp As Single, rarray() As Single) As Integer
' This routine returns as its value a pointer to the first occurance
' of 'temp' in the real array 'rarray'. The first 'n' positions
' in 'rarray' are searched. If 'temp' does not occur in those positions
' IPOS3 is equal to 0. Example:
' n = 4
' temp = 22.3
' iarray = 16.1,23.78.,22.3,24.12
' IPOS3 will be set to 3

ierror = False
On Error GoTo IPOS3Error

Dim i As Integer

If n% <= 0 Then GoTo Fail3
For i% = 1 To n%
If rarray!(i%) = temp! Then GoTo Found3
Next i%

Fail3:
IPOS3 = 0
Exit Function

Found3:
IPOS3 = i%
Exit Function

' Errors
IPOS3Error:
MsgBox Error$, vbOKOnly + vbCritical, "IPOS3"
ierror = True
Exit Function

End Function

Function IPOS4(ByVal n As Integer, ByVal sym As String, symray() As String) As Integer
' This routine returns as its value a pointer to the first occurance
' of 'sym' in the character array 'symray'. The first 'n' positions
' in 'symray' are searched but only the first character is checked!
' If 'sym' does not occur in those positions IPOS4 is equal to 0. Example:
' n = 6
' sym = "kb"
' symray = "ka","kb","la","lb","ma",mb"
' IPOS4 will be set to 1

' Use this formula to convert 1, 3, 5 to 1, 2, 3
' i% = i% - (i% - 1) + (i% - 1) / 2

ierror = False
On Error GoTo IPOS4Error

Dim i As Integer

If n% <= 0 Then GoTo Fail4
For i% = 1 To n%
If Left$(Trim$(LCase$(symray$(i%))), 1) = Left$(Trim$(LCase$(sym$)), 1) Then GoTo Found4
Next i%

Fail4:
IPOS4 = 0
Exit Function

Found4:
IPOS4 = i%
Exit Function

' Errors
IPOS4Error:
MsgBox Error$, vbOKOnly + vbCritical, "IPOS4"
ierror = True
Exit Function

End Function

Sub MiscAddCRToText(tText As TextBox)
' Add a <cr> to text box

Expand Down Expand Up @@ -851,84 +776,6 @@ Exit Sub

End Sub

Sub MiscReplaceString(astring As String, achar As String, bchar As String)
' Replace all occurances of "achar$" with "bchar$" in a string (obsolete, use Replace$ function instead)

ierror = False
On Error GoTo MiscReplaceStringError

Dim k As Integer

' If "astring$" is empty just return
If astring$ = vbNullString Then Exit Sub

' If "achar$" equals "bchar$" just return
If achar$ = bchar$ Then Exit Sub

' Check that "achar$" and "bchar$" are equal in length
If Len(achar$) <> Len(bchar$) Then GoTo MiscReplaceStringDifferentSize

k% = 1
Do Until k% = 0
k% = InStr(astring$, achar$) ' check for "achar$"
If k% > 0 Then Mid$(astring$, k%, Len(achar$)) = bchar$ ' replace with "bchar$"
Loop

Exit Sub

' Errors
MiscReplaceStringError:
MsgBox Error$, vbOKOnly + vbCritical, "MiscReplaceString"
ierror = True
Exit Sub

MiscReplaceStringDifferentSize:
msg$ = "Strings are different length"
MsgBox msg$, vbOKOnly + vbExclamation, "MiscReplaceString"
ierror = True
Exit Sub

End Sub

Sub MiscReplaceStringA(astring As String, achar As String, bchar As String)
' Replace all occurances of "achar$" with "bchar$" in a string (obsolete, use Replace$ function instead)

ierror = False
On Error GoTo MiscReplaceStringAError

Dim k As Integer

' If "astring$" is empty just return
If astring$ = vbNullString Then Exit Sub

' If "achar$" equals "bchar$" just return
If achar$ = bchar$ Then Exit Sub

' Check that "achar$" and "bchar$" are equal in length
If Len(achar$) <> Len(bchar$) Then GoTo MiscReplaceStringADifferentSize

k% = 1
Do Until k% = 0
k% = InStr(astring$, achar$) ' check for "achar$"
If k% > 0 Then Mid$(astring$, k%, Len(achar$)) = bchar$ ' replace with "bchar$"
Loop

Exit Sub

' Errors
MiscReplaceStringAError:
MsgBox Error$, vbOKOnly + vbCritical, "MiscReplaceStringA"
ierror = True
Exit Sub

MiscReplaceStringADifferentSize:
msg$ = "Strings are different length"
MsgBox msg$, vbOKOnly + vbExclamation, "MiscReplaceStringA"
ierror = True
Exit Sub

End Sub

Sub MiscSelectText(tText As Control)
' Select the current text (called from GotFocus event)

Expand Down Expand Up @@ -1451,46 +1298,6 @@ Exit Function

End Function

Function MiscReplaceStringSub(astring As String, bstring As String, cstring As String) As String
' Replace all occurances of bstring$ with cstring$ in astring$ (need not be same length) (obsolete, use Replace$ function instead)

ierror = False
On Error GoTo MiscReplaceStringSubError

Dim i As Integer, k As Integer
Dim tstring As String

' If "astring$" is empty just return
If astring$ = vbNullString Then Exit Function

' If "bstring$" equals "cstring$" just return
If bstring$ = cstring$ Then Exit Function

k% = Len(bstring$)
i% = 0
tstring$ = vbNullString
Do Until i% > Len(astring$)
i% = i% + 1
If Mid$(astring$, i%, k%) = bstring$ Then
tstring$ = tstring$ & cstring$
i% = i% + (Len(bstring$) - 1)
Else
tstring$ = tstring$ & Mid$(astring$, i%, 1)
End If
Loop

MiscReplaceStringSub$ = tstring$

Exit Function

' Errors
MiscReplaceStringSubError:
MsgBox Error$, vbOKOnly + vbCritical, "MiscReplaceStringSub"
ierror = True
Exit Function

End Function

Function IPOSDQ(ByVal n As Integer, ByVal sym1 As String, ByVal sym2 As String, sym1array() As String, sym2array() As String, dq() As Integer) As Integer
' This routine returns as its value a pointer to the first occurance (interference corrections only)
' of 'sym1' and 'sym2' in the character array 'sym1array' and 'sym2array' that are not disabled.
Expand Down
4 changes: 2 additions & 2 deletions miscsystem.bas
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ Private Const STANDARD_RIGHTS_REQUIRED As Long = &HF0000
Private Const SYNCHRONIZE As Long = &H100000
Private Const MUTANT_QUERY_STATE As Long = &H1
Private Const MUTANT_ALL_ACCESS As Long = (STANDARD_RIGHTS_REQUIRED& Or SYNCHRONIZE& Or MUTANT_QUERY_STATE&)
Private Const SECURITY_DESCRIPTOR_REVISION As Long = 1
Private Const DACL_SECURITY_INFORMATION As Long = 4
'Private Const SECURITY_DESCRIPTOR_REVISION As Long = 1
'Private Const DACL_SECURITY_INFORMATION As Long = 4

Public Declare Function OpenMutex Lib "kernel32.dll" Alias "OpenMutexA" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Boolean, ByVal lpName As String) As Long
Public Declare Function ReleaseMutex Lib "kernel32.dll" (ByVal hMutex As Long) As Long
Expand Down
Loading

0 comments on commit e65f002

Please sign in to comment.