Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm jumping down the rabbit hole of Vault and my collection of iLogic scripts now need to know the status of parts relating to Vault. I found some code that gives the Vault status but I want to have these functions in a single script file and reference them from multiple iLogic scripts. It sounds like I need to use a combination of addvbfile and straight vb code to get functions shared between scripts. I've found threads discussing this but no solid idiot proof examples of how to make this work.
Could someone either share an example of sharing a function or better yet tweak my code and give an example of using it from another script. Thanks.
'Other iLogic script calling shared function
Sub main
MsgBox(VaultReadOnly)
End Sub
'Shared functions
Public Function VaultReadOnly As Boolean
status = VaultStatus()
If (status = 0 Or status = 1) Then
Return False
Else
Return True
End If
End Function
Public Function VaultStatus As Integer
If (TCCI("VaultDataCardtop") = False) Then
Return 0 'Not in Vault
ElseIf (TCCI("VaultDataCardtop") = True And TCCI("VaultUndoCheckouttop") = True) Then
Return 1 'In Vault, Checked out
ElseIf (TCCI("VaultDataCardtop") = True And TCCI("VaultCheckouttop") = True) Then
Return 2 'In Vault, Not checked out
ElseIf (TCCI("VaultDataCardtop") = True And TCCI("VaultCheckouttop") = False And TCCI("VaultCheckintop") = False) Then
Return 3 'In Vault, Locked
End If
End Function
Private Function TCCI(VaultParam As String)
Return ThisApplication.CommandManager.ControlDefinitions.Item(VaultParam).Enabled
End Function
Solved! Go to Solution.