Forum Discussion

lbyrne's avatar
lbyrne
Contributor
11 years ago

Type mismatch - parameterizing script routines

In one script file called NewData I have the code below
The code that follows the dotted line is in a script file Basic and is being called from the script file called NewData

I am getting a type mismatch error.
I tried embedding the parameters in the subroutine called AddNewAttachmentCategory and it works.

Want to reuse same code and send in different parameters

What am I missing?

Thanks
Lynn


' USEUNIT Basic

Sub AddNewAttachmentCategoryRequiredFields

Call AddNewAttachmentCategory("REQUIRED","Attachment Category Required","","Yes","false")
Log.Message("Successful add of Attachment Category with Required Fields")

End Sub

-----------------------------------------------------------------------------------------------------------

Sub AddNewAttachmentCategory(AttachmentType,CategoryName,CategoryDescription,WebAccess,Disabled)

Call OpenScreen
Dim HSP_AdministratorTK
Dim frmAttachmentCategories
Dim groupBox
Dim toolkitTextbox

'AttachmentType = "REQUIRED"
'CategoryName = "Attachment Category"
'CategoryDescription =""
'WebAccess="Yes"
'Disabled = "false"
Set HSP_AdministratorTK = Aliases.HSP_AdministratorTK
Set frmAttachmentCategories = HSP_AdministratorTK.MDIForm.MdiClient.frmAttachmentCategories
Call frmAttachmentCategories.tspAttachmentCategories.ClickItem("New Attachment Categories")
Set groupBox = frmAttachmentCategories.splMain.SplitterPanel.splButtonBar.SplitterPanel.gbxProperties
Set toolkitTextbox = groupBox.txtCategoryName
Call toolkitTextbox.SetText(CategoryName)
Set toolkitTextbox = groupBox.txtCategoryDescription
Call toolkitTextbox.SetText(CategoryDescription)
Call groupBox.cboWebAccess.ClickItem(WebAccess)
if Disabled = "false" then
groupBox.ckbxDisabled.set_Checked(false)
else
groupBox.ckbxDisabled.set_Checked(true)
end if

groupBox.btnSave.ClickButton
HSP_AdministratorTK.dlgAddComplete.btnOK.ClickButton
'Tables.AttachmentCategories.Check
'DBTables.AttachmentCategories.Check
Call CloseScreen
End Sub