Académique Documents
Professionnel Documents
Culture Documents
CCLAS EL v1.4
Advanced
Prepared by:
Mincom Ltd
11 Autumn Road
Rivonia, RSA
South Africa
Tel:
Fax:
Web:
Version:
Date:
Table Of Contents
General Information.......................................................................................................................................... 6
Overview...................................................................................................................................................... 6
Classes........................................................................................................................................................ 6
Getting started with SQL................................................................................................................................... 6
Overview...................................................................................................................................................... 6
Opening SQL2005........................................................................................................................................ 7
Creating Users in SQL2005.......................................................................................................................... 9
Creating a CCLAS DB in SQL 2005........................................................................................................... 11
Installing CCLAS on the Server.................................................................................................................. 15
Installing CCLAS on a Workstation............................................................................................................. 25
Back Up and Restore................................................................................................................................. 31
Backup the Database............................................................................................................................. 31
Restoring a Database............................................................................................................................ 36
Database diagram...................................................................................................................................... 43
SQL Queries............................................................................................................................................... 46
DBCC DROPCLEANBUFFERS............................................................................................................. 46
SELECT queries.................................................................................................................................... 47
INSERT queries..................................................................................................................................... 48
UPDATE queries.................................................................................................................................... 48
Using the Query Designer.......................................................................................................................... 48
Getting started with CCLAS............................................................................................................................ 56
CCLAS.INI.................................................................................................................................................. 57
Running CCLAS the first time..................................................................................................................... 58
Running CCLAS with a new Laboratory Code............................................................................................ 60
GlobalSettings............................................................................................................................................ 61
Look at the Menu:....................................................................................................................................... 64
Diagrams................................................................................................................................................ 64
CCLASEL Module Relationship............................................................................................................. 67
Program Settings and the Programs They Relate To.................................................................................67
Settings...................................................................................................................................................... 72
GlobalSettings........................................................................................................................................ 72
Initialization Variable Settings................................................................................................................. 79
General....................................................................................................................................................... 80
Directories.............................................................................................................................................. 80
Setting up Tip files...................................................................................................................................... 81
Staff................................................................................................................................................................ 81
Settings...................................................................................................................................................... 82
Profile Screen Files................................................................................................................................ 84
Runn Files.............................................................................................................................................. 88
Other Modules........................................................................................................................................ 89
Setup.............................................................................................................................................................. 89
ii
Table Of Contents
Unique Numbers........................................................................................................................................ 89
Rounding Codes......................................................................................................................................... 93
Where may all the Setup settings used?.................................................................................................... 94
Laboratory Sections............................................................................................................................... 94
Holidays................................................................................................................................................. 95
Unit Codes............................................................................................................................................. 95
CCLAS API..................................................................................................................................................... 96
Intrinsic Controls in CCLAS scripting.......................................................................................................... 96
Customised Controls With Limited Events................................................................................................ 103
Standalone scripts.................................................................................................................................... 106
Integrated scripts...................................................................................................................................... 106
Setup scripts........................................................................................................................................ 106
Processing scripts................................................................................................................................ 107
Management scripts............................................................................................................................. 107
Customizing the Logon Screen............................................................................................................ 108
User Screens............................................................................................................................................ 108
<module>UserQuery.SCR........................................................................................................................ 126
ClientUserQuery.SCR.......................................................................................................................... 130
ClientCostUserQuery.SCR................................................................................................................... 131
ClientGroupUserQuery.SCR................................................................................................................ 131
ProcRegUserQuery.SCR..................................................................................................................... 131
ProductUserQuery.SCR....................................................................................................................... 132
QCUserQuery.SCR.............................................................................................................................. 133
ProfileUserQuery.SCR......................................................................................................................... 133
SchemeUserQuery.SCR...................................................................................................................... 134
MDEUserQuery.SCR........................................................................................................................... 134
MDESampleUserQuery.SCR............................................................................................................... 135
RepUserQuery.SCR............................................................................................................................. 135
InvoiceUserQuery.SCR........................................................................................................................ 136
AuditJobUserQuery.scr........................................................................................................................ 136
SamTrackUserQuery.SCR................................................................................................................... 137
SamTrackAddUserQuery.scr................................................................................................................ 137
<module>User.SCR................................................................................................................................. 138
GroupingUser.SCR.............................................................................................................................. 140
GroupSectionUser.SCR....................................................................................................................... 140
InstrumentUser.SCR............................................................................................................................ 141
LabUser.SCR....................................................................................................................................... 141
LobUser.SCR....................................................................................................................................... 141
SectionUser.SCR................................................................................................................................. 142
StatusCodesUser.SCR......................................................................................................................... 142
UnitUser.SCR....................................................................................................................................... 143
CannedCommentsUser.SCR............................................................................................................... 143
ClientContactUser.SCR........................................................................................................................ 143
iii
CCLASEL 1.4
ClientProjectUser.SCR......................................................................................................................... 144
ClientQuoteUser.SCR.......................................................................................................................... 144
ClientUser.SCR.................................................................................................................................... 144
CostCentreUser.SCR........................................................................................................................... 145
GroupClientUser.SCR.......................................................................................................................... 145
ProcRegSchemeAnalyteUser.SCR...................................................................................................... 146
ProcRegSchemeUser.SCR.................................................................................................................. 146
ProcRegUser.SCR............................................................................................................................... 146
ProductAnalyteUser.SCR..................................................................................................................... 147
ProductUser.SCR................................................................................................................................. 147
QControlUser.SCR............................................................................................................................... 147
SchemeAnalyteUser.SCR.................................................................................................................... 148
SchemeUser.SCR................................................................................................................................ 148
ProfJobCuidUser.SCR......................................................................................................................... 149
ProfJobSchemeAnalyteUser.SCR........................................................................................................ 149
ProfJobSchemeUser.SCR.................................................................................................................... 149
ProfJobUser.SCR................................................................................................................................. 150
STJobUser.SCR................................................................................................................................... 150
STJobSampleUser.SCR....................................................................................................................... 151
STPhysicalTypeUser.SCR................................................................................................................... 151
InvoiceUser.SCR.................................................................................................................................. 151
LabMaintScheduleUser.SCR............................................................................................................... 152
LabMaintUser.SCR.............................................................................................................................. 152
CMConsumeUser.SCR........................................................................................................................ 153
CMConsumeTypeUser.SCR................................................................................................................ 153
CMConsumeSupplier.SCR................................................................................................................... 154
*UDF.VBS................................................................................................................................................. 154
LabUDF.VBS........................................................................................................................................ 155
ProcRegUDF.VBS................................................................................................................................ 156
ProSchemeAnalyteUDF.VBS............................................................................................................... 157
ProSchemeUDF.VBS........................................................................................................................... 157
ProUDF.VBS........................................................................................................................................ 158
DBCUDF.VBS...................................................................................................................................... 168
BatchUDF.VBS..................................................................................................................................... 169
RepUDF.VBS....................................................................................................................................... 171
PRepUDF.VBS..................................................................................................................................... 173
InvUDF.VBS......................................................................................................................................... 175
StatUDF.VBS....................................................................................................................................... 180
PrfUDF.VBS......................................................................................................................................... 181
LabMaintUDF.VBS............................................................................................................................... 184
*Runn Settings......................................................................................................................................... 185
ConsumablesRunn............................................................................................................................... 185
MDERunn............................................................................................................................................ 185
iv
Table Of Contents
SamanaRunn....................................................................................................................................... 185
Profile - ScreenFilen............................................................................................................................. 186
SamReg - ScreenFilen......................................................................................................................... 186
Taskman - AutoRunn............................................................................................................................ 187
LabMaintenanceRunn.......................................................................................................................... 187
SampleTrackRunn............................................................................................................................... 188
ConsumablesRunn............................................................................................................................... 188
*AddNew.SCR.......................................................................................................................................... 189
ProcregSchemeAddNew.scr................................................................................................................ 189
ProductSchemeAddNew.scr................................................................................................................ 189
ProfjobAddNew.scr............................................................................................................................... 189
ProfjobProcedureAddNew.scr.............................................................................................................. 190
ProfjobSchemeAddNew.scr................................................................................................................. 190
ProfjobAnalyteAddNew.scr................................................................................................................... 191
BatchProcedureAddNew.scr................................................................................................................ 191
BatchSchemeAddNew.scr.................................................................................................................... 191
QuoteProcedureAddNew.scr................................................................................................................ 192
QuoteSchemeAddNew.scr................................................................................................................... 192
Module Specific scripts............................................................................................................................. 193
Profile................................................................................................................................................... 193
SamReg............................................................................................................................................... 195
Samana (Online).................................................................................................................................. 195
MDE..................................................................................................................................................... 196
ccComm01.dll...................................................................................................................................... 200
IFF Scripting............................................................................................................................................. 203
Properties............................................................................................................................................. 203
Methods............................................................................................................................................... 208
What is wrong when ................................................................................................................................. 217
General Information
Overview
CCLAS 1.4 Advanced Training is for those of you that know CCLAS from a user perspective, very well. In
this course we will be dealing with all those things that happen behind CCLAS, the things you cannot see or
are not obvious to the normal CCLAS user.
We will review every module very quickly, just to refresh your memory. For each module, we will be looking
at the setting you may find in the Staff module. For this, it is essential that you understand how the settings
and programs link with each other, and which classes to use.
Classes
Classes are pieces of code that is written in source, in the case of CCLAS with Visual Basic 6, where you
cannot see the code. A class is a category of things; an object is a specific instance of a class. A class
definition is a set of program statements that tell you the characteristics of the classs objects and the
methods that can be applied to its objects.
We are not going to learn here how to create classes, as it is beyond the scope of this course.
The classes that exist in CCLAS, will be discussed later in this document.
CCLAS 1.4
Opening SQL2005
Click on Start All Programs Microsoft SQL Server 2005 SQL Server Management Studio, as in the
screen capture below:
Make sure that the selections in the dropdown boxes are as follows:
Server Type:
Database Engine
Server Name:
The name of the server where you will install your database. In some cases, it
would be a networked server, in some cases we will treat our PCs as servers. If we
use a network server, the tutor will supply you with a server name. Else, your
computer name will be the server name. How can I find the name of my PC?
Authentication:
We will start off using Windows Authentication, since we are going to create the
Database Owners name first.
CCLAS 1.4
If the SQL2005 instance has never been used, you will only see logins which have been created during the
SQL installation. Else, as is in the case of the above screen shot, you will see users who have been created
by the DBA.
To create your own user / owner, right-click on Logins and select the New Login item on the floating menu:
CCLS
Password:
Uncheck this
Leave the other settings on the screen as they are, and click the OK button.
The user you have created, will now appear under the Logins option on the screen:
10
CCLAS 1.4
Now collapse the Security option by clicking on the minus (-) to the left of Security.
When you expand the Databases option, you will see a list of all databases which have been created on this
server / PC. Else, those that have the red icon to the left of them, will not exist.
To create a new database, right-click on Databases, and select the New Database option on the floating
menu, as in the screen shot below:
11
12
CCLAS 1.4
Database name:
Type a name for your database. For purposes of this course, use your own
discretion of what you want to call the database. Let us all enter it in caps, one short
word.
Owner:
Select the CCLS user you have created under Security. How do I find the user?
When a database is created, it creates an MDF file and an LDF file. The MDF file holds all the information
which exists in the database, and the LDF file is a log file. We are not going into an in-depth explanation of
these two files, but we will see how to change the location of these files.
Scroll to the right of the screen by clicking on the vertical scroll bar. You will see something similar to what
appears on the following screen. By default, when you create a database, SQL will place the MDF and LDF
files in SQLs Data location.
Click on the ellipse button (). The following screen will appear:
13
On this screen above, you will see the path which SQL has selected by default. We are going to leave it like
that. Mostly, the DBA or your IT department has separate drives or directories which will hold data, and thus
the path to that directory would be selected.
Click on Cancel to close this screen, and click on OK on the previous screen to create the database.
Now you will see the database you have just created, in the database list, as in the screen capture below:
14
CCLAS 1.4
15
16
CCLAS 1.4
On this screen, you will set the Destination Folder. This is where the EXE will be installed to. The EXE
directory holds the program files.
If you wish to do the CCLAS Server installation to another directory than the default C:\CCLASEL directory,
click on the Browse button to navigate to another directory, as in the following screen capture:
If you each have your own PC that will double as a Server and a Workstation, leave it as the default, i.e.
C:\CCLASEL. Else, your tutor will tell you where to install CCLAS to (for this, you will use a utility like VNC).
Click on OK.
Click on the Next button.
17
Since we are busy doing a server installation, select the Full option. This will take you to the following
screen:
All EXEs, DLLs and OCXs will be installed. If you are doing a fresh installation of
CCLAS, it is essential that you select this option.
Database:
18
CCLAS 1.4
Directories:
Will place sub-directories in the folder you have selected on a previous screen, in
this case C:\CCLASEL.
Sentinel:
If your CCLAS licences are installed by using a Sentinel, you will select this option.
Your CCLAS provider will tell you to use or not use the Sentinel option. For training
purposes, we will not use it.
Help:
The option you select on the above screen, will place the CCLAS.INI file in the corresponding directory. In
this case, we select the Windows directory.
Click the Next button.
19
Since we are using SQL2005, select the SQL Server Unicode (2000) option.
Click the Next button.
20
CCLAS 1.4
Remember the Username, Password and Database you have created in SQL2005? It is essential that, what
you filled in on this form, is exactly the same as what you have created in SQL.
Username:
CCLS
Password:
CCLS
DSN:
<ServerName>;<DB Name>
Make sure that the ServerName is the name of the Server you have installed the
Database to. How do I find the Server / PC name? The DB Name is the name you
have assigned to your CCLAS database when you created it in SQL2005. These
two names are separated by a semi-colon.
21
On this screen, you will select the main directory where the other sub-directories will be installed to. As you
can see, the program files do not have to reside in the same parent directory as the other directories. For
purposes of this training, we will leave the Data Directory as CCLAS sets the default.
Click the Next button:
22
CCLAS 1.4
Check if your directories are correct as intended to be, and click the Next button.
If the program warns you that information will be added to the Registry, click on OK. We will not study the
registry during this course.
23
If you see the following screen appearing, it means that the database already exists, and you are re-installing
it. It may happen, at times, that you need to do this, should the database have been damaged for some
reason or an update has been released. Keep in mind that any original fields which have been changed to
suit the users requirements, will be updated to suit the default CCLAS installation. It is safer to let a CCLAS
consultant help you through the process of updating your database.
As soon as the database have been installed, the following screen might appear.
Click on OK.
24
CCLAS 1.4
The InstallShield Wizard will show that the installation is complete, so click Finish to restart your computer.
The following steps are the same as for the Server installation:
25
26
CCLAS 1.4
Normally, the Destination folder should point to the directory on the Server where the EXEs, OCXs and DLLs
(i.e. the Program Files), have been installed. You can change it by clicking the Browse button, and browsing
to the Servers CCLASEL directory.
In some cases, one might choose to run the Program files directly from the PC. It is very important to
remember that this is an administration nightmare for the client, and should be avoided at all costs.
Click on the Next button:
27
On the above screen, select the Workstation installation, and click the Next button.
Select the directory where the local CCLAS.INI file will be copied to.
28
CCLAS 1.4
Check that your Program Folders option is correct. Click the Next button.
29
On the screen above, check that files will be copied to the directories as was intended, and click the Next
button.
After CCLASEL has been installed, the message as above might appear, just click on the OK button.
30
CCLAS 1.4
31
32
CCLAS 1.4
Backup Type:
If your consultant requests a backup of your database, select the Full option. For
routine backup purposes, your DBA will decide which backup option should be done.
Backup component:
Also, if you make a backup to send to your consultant, you will select the Database
option.
Name:
Destination:
Here we may select a destination where our backup files will be placed. For
purposes of this course, click on the Remove button to remove the default path.
Now click on the Add button to add another backup location. The following screen
will appear:
33
Scroll to the Backup directory under your CCLASEL main directory. If you have installed CCLAS for the first
time, the Backup directory will not exist, so go ahead and create it.
Selected Path:
File Name:
34
CCLAS 1.4
Make sure that your path and filename are what you intended them to be.
Click OK
If all settings are correct in the screen like above, click on OK.
When the backup has been completed, the next screen will appear:
35
Restoring a Database
For the purposes of this training, we are not going to use the database we have just created. From now on,
we will use an existing database, since it contains Staff, Clients, Methods, Jobs and more which has been
set up during the CCLAS Basic Training Course.
So, let us restore an existing database to the one we have just created.
36
CCLAS 1.4
The General item in the left pane is selected by default. Make sure that the following are correct:
To database:
From device:
Using the ellipse button, browse to the backup you need to restore. Your tutor will
tell you which backup to restore. How do I browse to the backup I need to restore?
Select :
After you have browsed to the backup you want to restore, the name of the
database will appear in the explored-like box at the bottom of the screen. Select the
tick box next to it.
37
Select the Overwrite the existing database option by ticking the square.
Restore the :
For the first Original File Name, browse to the MDF file that you have created earlier
by clicking on the ellipse button. How do I do that?
For the second Original File Name, browse to the LDF file that you have created
earlier by clicking on the ellipse button. How do I do that?
Click on OK.
As soon as the database has been restored, the following screen will appear:
Click on OK.
Remember, since you have restored an existing Database over the one you have created, the owner of the
database will not be the same as the original owner. You will either have to change the owner, or you will
have to add the user you have created (CCLS in this case), in the Security setup of the database.
38
CCLAS 1.4
39
In the left pane, select the Files option. In the right pane, change the Owner to the one you have created
earlier CCLS.
Adding a User
In some cases, it will be necessary to add more users to your database. That will only happen if another
system connects directly to the database, and they have their own logon. Keep in mind that this will be a
security concern, as in all instances of SQL databases the more users have access to your database, the
greater the chances of unauthorized changes are.
You do not need to create a database user for the CCLAS Staff Codes loggin on to your database this is
handled by the CCLAS Security model.
The add the CCLS user to your database, is not necessary in this case, since it is the owner of your
database. But for illustration purposes, we are going to add CCLS as a user.
Expanding Security and then Logins, you will see the CCLS user:
40
CCLAS 1.4
Double-click on CCLS to open its properties pages, and select the User Mapping option in the left pane.
41
If the user you have double-clicked, was set to be the Owner of the database, the acronym dbo will appear
in the second column, as well as in the third column.
Suppose we want to add another user to the database let us create the user CCLASMGR.
Double-click on the CCLASMGR user to set it as a user to the database:
42
CCLAS 1.4
Select the database to attach CCLASMGR to. The user will now show as CCLASMGR. In the Default
Schema column, change it to dbo. How do I do that?
In the Database role membership list box, select the db_owner setting. It will allow CCLASMGR a great
amount of access to the CCLAS database.
Click on OK.
Now you may use either CCLS or CCLASMGR for CCLAS to be able to log onto the database.
Database diagram
The database diagram will show how the tables in the database are connected to each other. Explaining this
is beyond the scope of this course, but you will need to know how they are connected to be able to write
queries.
The first time you click on the Database Diagrams option under the database you have created and restored,
you might get the following message:
43
A screen which contains all the tables in the database, will appear:
44
CCLAS 1.4
I have selected the ProfJob group of tables, since these are the tables we will use most often during this
course. You can create a diagram of the entire database by selecting all the tables which belong to this
database.
Click on the Add button.
The tables you have selected, are added to the diagram, as is demonstrated in the following screen capture:
After you have created the database diagram, right-click on the tab and select the Save option.
45
Click on OK.
The screen will now have your diagram available:
SQL Queries
It is beyond the scope of this course to teach you how to write SQL queries. Only the basic principles of SQL
SELECT queries will be covered. We will not cover DELETE queries at all, a quick overview of UPDATE and
INSERT queries will be done.
DBCC DROPCLEANBUFFERS
Use DBCC DROPCLEANBUFFERS to test queries with a cold buffer cache without shutting down and
restarting the server.
This is useful when running huge queries.
46
CCLAS 1.4
SELECT queries
SELECT queries are used to pull data out of the database it works on the same principle as filters do in
Excel, for example, but you do not set it up the same way.
SELECT queries have the following structure:
SELECT
<fieldname1>, <fieldname2>
FROM
<tablename1>, <tablename2>
WHERE
<statement>
ORDER BY
<order statement>
Let us use the Profjob group of tables we have earlier created a database diagram for:
Assume we want to get a list of Samples which have been registered in CCLAS.
SELECT
SampleIdent
FROM
ProfJob_Cuid
Now assume we are looking for all Samples which have been registered for the Client Coal_Mine.
Remember, all Sample Ids appear in the ProfJob_Cuid table. But the Client Codes only appear in the
ProfJob table.
So, we have to join these two tables to get sensible data out of them:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
SELECT
FROM
Cli_Code,
ProfJob.Pro_Job,
SampleIdent
ProfJob_Cuid,
ProfJob
WHERE
ProfJob.Pro_Job = ProfJob_Cuid.Pro_Job
AND ProfJob.Cli_Code = 'Coal_Mine'
The above query will now show, in tabular form, the Client Code which is only Coal_Mine, all Jobs that exist
for that client, and Samples that appear in those jobs.
But in line 10, it reads: ProfJob.Pro_Job = ProfJob_Cuid.Pro_Job. Why? Because the Pro_Job
field exist in both tables, and they should be equal to each other to retrieve the correct data.
Let us view all the Schemes (analytical methods) that belong to the Jobs that appear in the tabular list:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
47
SELECT
Cli_Code,
ProfJob.Pro_Job,
SampleIdent
FROM
WHERE
ProfJob_Cuid,
ProfJob,
ProfJob_Cuid_Scheme
ProfJob.Pro_Job = ProfJob_Cuid.Pro_Job
AND ProfJob_Cuid_Scheme.Pro_Job = ProfJob_Cuid.Pro_Job
AND ProfJob_Cuid_Scheme.Cuid = ProfJob_Cuid.Cuid
AND ProfJob.Cli_Code = 'Coal_Mine'
In line 8, we have selected another table that has to be queried it is the table that contains the Schemes
that are linked to the Sample ID in the ProfJob_Cuid table, as well as to the Job in either the ProfJob or
ProfJob_Cuid table. Look at line 11 and 12 this is where we set some fields on the ProfJob_Cuid_Scheme
table equal to some fiels in the ProfJob_Cuid table. Both the Pro_Job and the Cuid field appears in both,
and they have to be the same throughout, hence this connection.
INSERT queries
The basic construction of INSERT queries are as follows:
INSERT INTO
<tablename>
VALUES (
<Fieldname1>,<Fieldname2>
UPDATE queries
The basic construction of UPDATE queries are as follows:
UPDATE
SET
WHERE
<tablename>
<fieldname> = <value>
<statement>
Queries get a lot more complicated than this. This will be evident when we look at some scripts nearly all
CCLAS scripts contain queries that either: query data, insert data or delete data from the database.
48
CCLAS 1.4
Click on the Query menu item, and select the Design Query in Editor item:
49
50
CCLAS 1.4
Note that we have a blank screen in the background, and a list box with all the tables that exist in the
database in the foreground.
Let us do the exact queries that we have done previously, when we typed up the queries manually so
select only the ProfJob_Cuid table and click the Add button. Drag the SampleIdent field into the middle part
of the screen, where it says Column Name:
51
At the bottom of the screen, you can see the query which has been built the syntax is the same as the one
we have typed manually.
Now we want to see the Jobs and the Clients as well, where the Client is Coal_Mine.
Right-click on the white space, and select Add Table:
52
CCLAS 1.4
53
There is not only ONE link as we have typed up in our manual query, but TWO! Why? Because all the 1.4
versions of CCLAS is about multi-lab databases. We can have data for more than one laboratory in the
same database.
If we do not set the LabCodes equal to each other, and it so happens that the Precious Metals Laboratory
and the Base Metals Laboratory by chance have the same Clients, we are going to return a result which is
not accurate!
Note that the bottom screen shows the query that has automatically been built and it uses INNER JOINS.
That is a SQL connection between two tables but the recordset will be exactly the same as what we would
find in the manual query, if we did in fact use LabCodes.
Joins can get much more complicated than this and there are times that one cannot get past using joins
but that is beyond the scope of this course.
OK, so let us add the Scheme, or analytical method, to our result set. Once again, add another table, this
time select the ProfJob_Cuid_Scheme table:
54
CCLAS 1.4
Once again, the links are automatically added, and the query is automatically being built when you drag the
fields you need to see, into the Column of the middle part of the screen.
As soon as you are happy that you have all the desired fields included in the query, click on the OK button.
The query is transferred onto the query screen, just as it would have been if we typed it manually:
55
If your query is complete, you may now copy it, and use it in a script.
56
CCLAS 1.4
CCLAS.INI
After you have installed CCLAS, the CCLAS.INI file was written to the directory you have specified during
installation. The CCLAS.INI file exist both on the Application / Database server, as well as on each
Workstation CCLAS was installed to. For the purposes of this course, the CCLAS.INI file was installed to the
Windows directory.
Before running CCLAS for this first time, the CCLAS.INI file looks like this:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
[CCLAS]
ErrorDLL=C:\CCLASEL\EXE\CCERRES.DLL
MessageDLL=C:\CCLASEL\EXE\CCMESSES.DLL
ExtendedErrorMessage=Enabled
Language=0
ForceODBC=Disabled
Debug=Disabled
ConnectionName=CCLAS EL Version 1.3
ConnectionPoolMinimumSize=0
ConnectionPoolTimerRefresh=0
Line 6, if ForceODBC is Enabled, the screen that forces the connection to the database will appear each
time you start up CCLAS.
The first time you execute CCLAS, the CCLAS.INI file will change to add the connection string. The file will
look like this:
1.
2.
3.
4.
5.
6.
57
[CCLAS]
ErrorDLL=C:\CCLASEL\EXE\CCERRES.DLL
MessageDLL=C:\CCLASEL\EXE\CCMESSES.DLL
ExtendedErrorMessage=Enabled
Language=0
ForceODBC=Disabled
7.
8.
9.
10.
11.
12.
13.
14.
Debug=Disabled
ConnectionName=CCLAS EL Version 1.3
ConnectionPoolMinimumSize=0
ConnectionPoolTimerRefresh=0
DSN=LENOVO-B582864C;COURSE
UID=CCLS
PROVIDER=SQLOLEDB
PWD=fry~!
Note that line 11 to 14 have been added to the CCLAS.INI file. Where do these lines come from?
Provider:
UID:
User ID as you have entered when you created the database in SQL
PWD:
The Password you have entered when you created the database.
58
CCLAS 1.4
To fix this, you may either delete the last four rows that have been added to the CCLAS.INI file, or you may
set Line 6, where it refers to ForceODBC, to enabled. Enabling line 6 will force the ODBC screen to appear
again with your next attempt to log on to CCLAS.
When all the data in the ODBC screen have been entered correctly, and the CCLAS.INI file has thus been
updated correctly, the following screen will appear:
59
no icons appear! Why does this happen and how do you fix this?
Remember, we have restored an already existing database to the ones we have created. Which means, the
database was originally created on another Server / PC, and may thus point to a different path as to where
you have installed your program files.
The URLs to EXEs are stored in the Staff_Program_CFG table. So, we will run the Staff program directly,
bypassing the menu:
60
CCLAS 1.4
GlobalSettings
All settings that apply to the Laboratory Code you have logged into, appear under the Global Settings. Only
one Staff Code has access to the Global Settings the CCLASMGR.
So in the Staff Module, you will double-click on CCLASMGR, and click on the Settings tab to access the
Global Settings. How to do this, is explained in the Basic Training material under the Staff section.
Let us look at the Root directory for CCLAS:
61
No that the CCLASRootDirectory points to the path C:\MMQ\DEMO\. Obviously this path is not the one we
have installed our directories to, we have to change it.
You can either change it by double-clicking on the CCLASRootDirectory setting:
or by pressing Ctrl+Enter:
62
CCLAS 1.4
Suppose you have installed the Program Files to the same main directory as where you have installed the
other directories, you may choose to enter %CCLASRootDirectory%EXE\. But what if the EXEs have been
installed to a different directory than the Root? You will need to enter the true path of where the EXEs are,
as in the screen shot above.
So, when you log in again, the correct menu will appear:
63
Diagrams
Setup Modules
64
CCLAS 1.4
Analysis Modules
65
66
CCLAS 1.4
Processing Modules
Management Modules
Licence
Job
Status
Staff
QC (PerfAna)
Setup
Batch
SPC (StatPC)
Client
On-Line (Samana)
Dashboard
Method
Audit
Analytical Report
Job Audit
Invoice
SamTrack
Taskman
LabMaint
Revenue
Consumables
The Modules existing in the Configuration group, first have to contain all data for Modules in the Processing
group to work correctly; and Modules in the Processing group have to contain all information for the Modules
in the Management group to work correctly.
How to set up or use of all these Modules are explained in the Basic Training Course.
Module
Licence
Table or Function
LICENCE
Relating Description
Controls the Licence program settings which perform
the function of adjusting the workstation licensing
recorded. User can add/delete workstations from this
table.
67
Module
CCLAS Menu
Table or Function
CCLAS
Relating Description
This is the CCLAS Main menu application. Normally
all users will be able to run this application (ie 1 or 2),
but not all users should be able to adjust their own
menu (access 3).
Staff
STAFFAPP
STAFF
GROUPING
Setup
CONFIG
LAB
LOB
GROUPLAB
SECTION
GROUPSECTION
HOLIDAYS
UNIQUENO
IDENTRULES
UNIT
ROUNDING
STATUSCODES
INSTRUMENT
TAX
INVCONVERSION
PRICE
GROUPPRICE
68
CCLAS 1.4
Module
Table or Function
CANNEDCOMMENTS
Relating Description
Controls the settings of the Canned Comments that
can be recorded and used in custom programs/scripts
etc.
Client
CLIENTAPP
Method
CLIENT
GROUPCLIENT
COSTCENTRE
SCHEMEAPP
SCHEME
PRODUCT
PROCREG
QCONTROL
Job
PROFILE
PROFILEAPP
Sample Type
SAMREG
Batch
BATCH
On-Line
SAMANA
Data Entry
MDE
Analytical Report
REPORT
Invoice
INVOICE
Audit
AUDIT
Job Audit
AUDITJOB
69
Module
Status
Table or Function
STATREP
Relating Description
Controls the Status Report program and the settings
when it runs.
Revenue
REVENUE
QC
PERFANA
SPC
STATPC
Sample Track
SAMPLETRACK
STLOCATION
STCONTAINER
STPHYSICALTYPE
STACTION
STJOB
Lab Maintenance
LABMAINTENANCE
LABMAINT
LABMAINTAUDIT
Consumables
CONSUMABLES
CMCONSUME
CMSUPPLIER
70
CCLAS 1.4
Module
Table or Function
CMCONSUMETYPE
Relating Description
Controls the settings of the types (categories) of
Consumables used in the lab.
Dashboard
DASHBOARD
Communication
COMMVIEW
View
General Utilities
GENUTIL
Global Laboratory
GLOBALSETTINGS
USERGLOBALSETTINGS
USERSETTINGS
This section stores all the default user settings for nonstandard or customised settings that may no be
program specific or across multiple programs. These
settings can be user specific.
ONLY USED AS PART OF CUSTOMISED
SOLUTIONS NOT USED IN STANDARD CCLAS.
Task Scheduler
TASKMAN
71
Settings
GlobalSettings
As we have seen earlier, the Global Settings control the settings that apply globally throughout the whole of
CCLAS, for the selected Lab Code. The GlobalSettings setting is only available to CCLASMGR.
Next is an explanation of what every Global Setting does and mean:
Setting
Value
Details
Accreditation
<text>
AllowCascadeUp-
Enabled / Disabled
IncompleteStatuses
ApplicationPicture
%CCLASRootDirectory%
%CCLASRootDirectory%
ARCHIVE
AuditFormatted-
Enabled / Disabled
ValueHistory
AuditHistory
Enabled / Disabled
AutoActivate
Enabled / Disabled
AutoCompleteWithout-
Enabled / Disabled
StatusCheck
AutoJobComplete
Enabled / Disabled
72
CCLAS 1.4
Setting
Value
Details
AutoLicenceOut
Enabled / Disabled
AutoPrepComplete
Enabled / Disabled
AutoProductValidation
Enabled / Disabled
AutoSchemeComplete
Enabled / Disabled
AutoStoreFormatted-
Enabled / Disabled
Value
AutoUnitConversion
Enabled / Disabled
AveragePriority
BaseCurrency
<currency unit>
BinDirectory
73
%CCLASRootDirectory%
BIN
Setting
Value
Details
CCLASRootDirectory
<//servername/cclasel
directory>
CertifyingOfficer
<text>
CertifyingOfficerTitle
<text>
CollDirectory
%CCLASRootDirectory%
COLL
CompanyName
<text>
ConfigDirectory
%CCLASRootDirectory%
CONFIG
ExeDirectory
%CCLASRootDirectory%
EXE
FormulaLocalised
Enabled / Disabled
HelpDirectory
%CCLASRootDirectory%
HELP
HelpFile
<text>
IdentsDirectory
%CCLASRootDirectory%
IDENTS
IFFScriptsDirectory
%CCLASRootDirectory%
IFFSCRIPTS
IncludeWeekends
Enabled / Disabled
74
CCLAS 1.4
Setting
Value
Details
INSTDataDirectory
%CCLASRootDirectory%
INSTDATA
InvoiceMessage
<text>
LaboratoryName
<text>
LBAddQCAlways
Enabled / Disabled
LBAutoJobNo
<Unique Number>
LBDefaultTemplate
LBIncludeNA
Enabled / Disabled
LoginDirectory
LoginOutEventLogFile
%CCLASRootDirectory%
LOGIN
%CCLASRootDirectory%
BinDirectory\
LoginOutEvent.log
LoginOutNTEventLog
Enabled / Disabled
MDEScriptsDirectory
%CCLASRootDirectory%
MDESCRIPTS
MinimumProrataBLK
MinimumProrataREP
75
One/Block / Zero /
One/Segment
or segment of samples.
One/Block / Zero /
One/Segment
Setting
Value
Details
MinimumProrataSPK
One/Block / Zero /
One/Segment
or segment of samples.
One/Block / Zero /
One/Segment
%CCLASRootDirectory%
NOTES
MinimumProrataSTD
NotesFileDirectory
Normally %CCLASRootDirectory%Notes.
PictureDirectory
%CCLASRootDirectory%
PICTURE
PriorityUnit
Hours / Days
ProcedureJob-
Enabled / Disabled
Pricecode
ProtectedFields-
<colour>
BackgroundColour
QCHistory
Enabled / Disabled
QControlDirectory
%CCLASRootDirectory%
QCONTROL
ReportDirectory
%CCLASRootDirectory%
REPORTS
ReportNonValidated
Enabled / Disabled
RunListDirectory
%CCLASRootDirectory%
RUN
76
CCLAS 1.4
Setting
Value
SpikeDesIdSource
Details
To determine the source of the PJC.DESCRIPTION
for spike samples, either SampleIdent,
ExternalIdent or Description of the original sample.
For example, if a sample with sample ident "ABC"
and external ident "DEF" were being spiked, if the
setting for SpikeDestIdSource were
[PJC.EXTERNALIDENT], the spike would get an
external ident of "DEF", but if the setting for
SpikeDesIdSource were [PJC.SAMPLEIDENT], the
spike would get an external ident of "ABC".
SpikeExtIdSource
TemplateDirectory
%CCLASRootDirectory%
TEMPLATES
UpdateLinkedSchemes
Enabled / Disabled
UpdatePriority
Enabled / Disabled
UseIdentsFiles
Enabled / Disabled
UseWindowsPassword
Enabled / Disabled
77
Setting
Value
Details
UseWindowsUsername
0/1/2
General
Directories
When you installed CCLAS, most of the directories were automatically created. Should you need more
directories, for instance, a backup directory, you may create it yourself. Through scripting, some additional
directories may be very useful.
All of us use the INSTData or InstrumentData directory (the name is up to the Client), where the data files
collected from instruments, are dumped. The IFFScripts the scripts that capture results out of the datafiles
look inside the INSTData directorys sub-directories to pick up files for every instrument.
The directories that are created during installation, are the following:
Directory
CCLASRootDirectory
\\<ServerName>\<CCLASELDirectory>\
ArchiveDirectory
%CCLASRootDirectory%ARCHIVE
BinDirectory
%CCLASRootDirectory%BIN
CollDirectory
%CCLASRootDirectory%COLL
ConfigDirectory
%CCLASRootDirectory%CONFIG
ExeDirectory
%CCLASRootDirectory%EXE\
HelpDirectory
%CCLASRootDirectory%HELP
78
CCLAS 1.4
IdentsDirectory
%CCLASRootDirectory%IDENTS
INSTData
%CCLASRootDirectory%INSTDATA
IFFScriptsDirectory
%CCLASRootDirectory%IFFSCRIPTS
LoginDirectory
%CCLASRootDirectory%LOGIN
MDEScriptsDirectory
%CCLASRootDirectory%MDESCRIPTS
NotesFileDirectory
%CCLASRootDirectory%NOTES
PictureDirectory
%CCLASRootDirectory%PICTURE
QcontrolDirectory
%CCLASRootDirectory%QCONTROL
ReportDirectory
%CCLASRootDirectory%REPORT
RunListDirectory
%CCLASRootDirectory%RUNLIST
TemplateDirectory
%CCLASRootDirectory%TEMPLATES
TipFileDirectory
%CCLASRootDirectory%TIPFILE
79
Staff
For more information on the Staff module, see the Basic Training Manuals, Staff section.
Except for creating new Staff Codes, we use the Staff module to control the behaviour of every other module
used in CCLAS.
We have already looked at Global Settings, the controlling settings of the whole of CCLAS for the Laboratory
CCLASMGR has signed into.
Settings
We are going to look at a few examples. Remember earlier we looked at Program Settings and the
Programs they belong to? Now we are going to delve a little deeper.
See the Staff settings again yes, the Staff Module contains its own settings as well!
Staff
STAFFAPP
STAFF
80
CCLAS 1.4
GROUPING
It is the settings that control the view of the Staff Module when you open it. In the
Settings document (Appendix B), under the Staff App settings, you will see the
following few:
AccessLevel, AllowProperties, MainListViewGrid, ShowTipOfTheDay and
TipOfTheDayFile. These are the only properties that are available for the STAFFAPP
setting.
STAFF
GROUPING
Not that the AccessLevel setting appears for each of these three Items. If the accesslevel for the STAFFAPP
item is set to 3, but the AccessLevel for STAFF and / or GROUPING are set to 0, the user is still allowed to
open the Staff Module, but will have no access to see Staff Codes or Staff Groups. Conversely, if the
STAFFAPP item is set to 1 (read access), but the Access Levels to STAFF and / or GROUPING are set to 3,
the user will have full access to STAFF and GROUPING regardless of his access to the STAFF Module
itself.
Let us take the settings for the Method (Scheme) Module:
Method
SCHEMEAPP
SCHEME
PRODUCT
PROCREG
QCONTROL
If a specific user is assigned to update Product limits only, but may not make changes to Schemes,
Procedures and QCs, what would happen? Maybe he may have read access to these three AccessLevel
1 but he will certainly have an Access Level 3 to Product. Also, he will have at least an Access Level of 1.
An Access Level of 0 will cause the following message:
81
Every time a new Staff Code is created, it automatically inherits all the settings as it exists for the
CCLASMGR. Upon creation all Access Levels are set to 0, and the administrator will have to set them
correctly according to which Modules the Staff Code will have to access.
Not that this Staff Code has been given an Access Level of 3 but no other settings are visible. How does it
know how to handle the Job part in the Profile (Job) module?
Look at the settings for CCLASMGR:
82
CCLAS 1.4
See that all relevant settings are visible now! Specifically look at the settings that start with ScreenFile. In
the screen shot above, you will see ScreenFile1 to ScreenFile5. This means that, when CCLASMGR opens
the Profile (Job) Module, all these registration scripts (screen files) are visible to him.
If we leave the Staff Code that we have created earlier, empty, all these registration scripts (screen files) are
also visible to him.
But assume that the new Staff Code should only see the registration script for Production Samples,
ScreenFile3, for CCLASMGR, and none of the others?
When you right-click to add a new setting, you will see the following screen:
83
On a previous screen capture, you have notices that ScreenFile3 refers to the Production Samples
registration screen. But you do not move ScreenFile3 over to the right! You move ScreenFile1 over. Why?
Because every setting that has a numerical order, must start from 1 and increment by 1 until the last setting
of the same type you add.
So, we add ScreenFile1 to the right:
84
CCLAS 1.4
But ScreenFile1 refers to Train Samples, so we have to change it. Double-clcik on ScreenFile1, and correct
the details:
85
Now the new Staff Code will only see the registration script for Production Samples when opening the Profile
module:
Runn Files
Suppose we have created a new VBScript that hase to calculate Averages between Replicates in MDE. This
file needs to be added to the dropdown next to the Command button. Every new SCR file or VBS file one
wants to add to any module, needs to be defined for CCLASMGR first before you can add it to any other
user as in the example of the Profile Screen Files.
Once again, in the Staff Module, look at the MDE settings for CCLASMGR.
86
CCLAS 1.4
Not the settings that start with MDERun it starts at MDERun1 and ends at MDERun6. We need to add
another VB to the dropdown so, we add a new MDERun7. Remember, these settings have to be in
numerical order.
Now this setting is available to add to specific users, if need to, as was done with the Profile screen in the
previous example.
Other Modules
The following other Modules have settings that work the same way:
Module
Setting
All Modules
ReportLDFn
CMConsume
UNITUnitTextn
VOLUnitTextn
WTUnitTextn
Consumables
ConsumablesRunn
MDE
MDERunn
Samana (Online)
SamanaRunn
Profile
ProfileRunn
ScreenFilen
SamReg
ScreenFilen
StatPC
AutoRunn
Taskman
AutoRunn
Lab Maintenance
LabMaintenanceRunn
Sample Track
SampleTrackRunn
Consumables
ConsumablesRunn
Setup
The Setup Module is explained in the CCLAS Basic Training Manual.
We will look at some of the settings in the Setup (Config) Module that are the responsibility of the CCLAS
Administrator, and seems likely to cause most confusion:
Unique Numbers
Unique numbers can be used whenever CCLAS EL needs the next available number in a numerical
sequence, for example, when entering new jobs or internal sample numbers.
Suppose the laboratory receives a new type of Sample on a routine basis let us create Unique Numbers
for Mining samples.
First, we want an automatic Job Number for Mining Jobs, in the following format:
MINE-2007-0001
87
Where:
MINE = identifier
070901 = yymmdd
0001 = incremental number
This format assumes that we will not generate more than 9999 Mining Jobs during 2007.
Firstly, the Sequency type is Job, since we are registering a Mining Job.
The Sequency format will define what format the Job number will take, as it appears in the floating screen in
the screen capture above. The Sequence format takes the syntax of
RV="MINE-"&CSTR(YEAR(NOW))&"-"&RIGHT("0000"+TRIM(CSTR(NUN)),4) for programmers this
will make more sense than for non-programmers.
So where and how does this Job number gets used?
When you open the Profile (Job) Module, to manually create a job i.e. without a registration screen the
Job sequence you have just created, appears in the Job Number dropdown. Every time a Mining Job is
created, you can use this way to do it, and the sequence will increment by 1 each time a new Job is
registered.
88
CCLAS 1.4
But the Unique number you have created is not only limited to automatic Job creation. One can use this
Unique number in scripts as well.
Next, we have to create a Unique number to name our Samples as well.
Suppose the format of the Sample is:
MIN-070901-001
Where:
MIN = Identifier
070901 = yymmdd
0001 = incremental number.
The Sample Ident above assumes that there will be no more than 999 Samples per day.
89
Now this sequence is available when you manually or automatically register samples:
In the following extraction from a script, it so happened that a specific instrument could not accept more than
12 characters. But the Sampleident was much longer than that so we use the Unique number system to
create an Instrument String for each Sample.
90
CCLAS 1.4
'=================================
'GET UNIQUE NUMBER
'=================================
Function GetUniqueNumber(sUniqueNo)
Dim oUniqueNo
'
Set oUniqueNo = CreateObject("CCCFG01.clsBDUniqueNo")
Set oUniqueNo.Security = clsSecurity
oUniqueNo.GetSequence sUniqueNo, True, "", Now()
'
If oUniqueNo.NoItems < 1 Then
Exit Function
End If
'
GetUniqueNumber = oUniqueNo.FirstUniqueNo
'
Set oUniqueNo = Nothing
End Function
'
Unfortunately this code on its own does nothing, it is simply a function used in a greater script.
Rounding Codes
Rounding codes are used when numerical data is to be reported, but rounded based upon the analytical
detection limit, a given picture format and a concept referred to as nice numbers conversion. Rounding is
based on ISO Rounding Rules.
Rounding codes are assigned to numerical analytes of schemes and are used when this analyte is included
in a report which requires rounding.
Each Rounding code has a table of values used to determine the rounding method.
91
In the screen capture above, we are specifically looking at the Rounding Table of the PPM measurement
unit. How does this table work?
Since it is the table for PPM, we can safely assume that all analysis are done in PPM, some will be reported
in PPM, and others will be reported in %.
Line 12 to Line 18 is about what the number should look like if the reporting happens in %. Suppose the
value of an analyte is 274380. Start at the top of the Detection Limit column. If you scroll down to line 12
where the value is 0, it seems likely that this is the entry point for rounding but moving one column to the
right, the next line shows a value that is less than the value our instrument has given. So if we move down
to where our value is between two of the values in the Ceiling column, that is where line 14 is less than our
value, but line 15 is more than our value, we will use the rounding in line 14. Since PPM has to be converted
to %, it will take into account the conversion factor as was set up in the Setup Module, under Unit Codes
and convert it to X.XX%.
All of us have experienced at some stage the ****** appears on the report, or the value is simply not there.
This is where you find the cause for that!
Laboratory Sections
Laboratory Sections can by default be used in the Method Module each Scheme may be carried out by
one of the Sections only in this case you will select the Section on the General Tab of the Scheme.
92
CCLAS 1.4
Holidays
Here are a few settings in the Staff Module that can co-operate to work out the date when Jobs are expected
to be completed. Assume we have created the days around Easter as Holidays it is 4 days. Suppose we
have set the GlobalSetting IncludeWeekends to Disabled, we have set the AveragePriority to 5, and we have
set the PriorityUnit to Days. The AveragePriority of 5 together with the PriorityUnit of Days, means that a Job
is required 5 days after it has been received in the laboratory. But suppose Easter weekend falls within
these 5 days? Since Easter weekend is 4 days long, and weekends are not included, it means that the
required date is now 9 days the 5 days it was originally allowed, plus the 4 days that fall on the Easter
weekend.
Unit Codes
We define unit codes to link to Analytes. The Analysis Unit Code may differ from the Reporting Unit Code, it
often happens that we measure an analyte in PPM and report it in %, as in the following screen capture:
93
CCLAS API
Intrinsic Controls in CCLAS scripting.
In Visual Basic there are a set of default controls built in to it, which are called intrinsic controls. These
controls cannot be handled as generically as other controls and as such need some special coding to make
them available to the CCLAS scripts.
The purpose of this document is to provide a list of the controls and the events available in CCLAS scripting.
All the properties and methods of the controls will be available (although methods that pass values by
reference will have problems as there is only a variant type in VBScript), so only the events available are
listed here.
94
CCLAS 1.4
Control
CheckBox
Events
Click
GotFocus
KeyDown
KeyPress
KeyUp
LostFocus
MouseDown
MouseMove
MouseUp
ComboBox
Validate
Change
Click
DblClick
DropDown
GotFocus
KeyDown
KeyPress
KeyUp
CommandButton
LostFocus
Validate
Click
GotFocus
KeyDown
KeyPress
KeyUp
LostFocus
MouseDown
MouseMove
MouseUp
DirListBox
95
Change
Click
Parameters
KeyCode
Shift
KeyAscii
KeyCode
Shift
Button
Shift
X
Y
Button
Shift
X
Y
Button
Shift
X
Y
Cancel
KeyCode
Shift
KeyAscii
KeyCode
Shift
Cancel
KeyCode
Shift
KeyAscii
KeyCode
Shift
Button
Shift
X
Y
Button
Shift
X
Y
Button
Shift
X
Y
Comments
Control
Events
GotFocus
KeyDown
KeyPress
KeyUp
Parameters
Comments
KeyCode
Shift
KeyAscii
KeyCode
Shift
LostFocus
Scroll
DriveListBox
Validate
Change
GotFocus
KeyDown
KeyPress
KeyUp
Cancel
KeyCode
Shift
KeyAscii
KeyCode
Shift
LostFocus
Scroll
DTPicker
Validate
Change
Click
DblClick
GotFocus
KeyDown
KeyPress
KeyUp
LostFocus
MouseDown
MouseMove
MouseUp
FileListBox
Validate
Click
DblClick
GotFocus
KeyDown
KeyPress
KeyUp
LostFocus
96
Cancel
KeyCode
Shift
KeyAscii
KeyCode
Shift
Button
Shift
X
Y
Button
Shift
X
Y
Button
Shift
X
Y
Cancel
KeyCode
Shift
KeyAscii
KeyCode
Shift
CCLAS 1.4
Control
Events
PathChange
Parameters
Comments
Fired when the
FileName or Path
property is changed
in code.
Fired when the
PatternChange
FileName or Pattern
property is changed
in code.
Fired when controls
Scroll
scroll box is
repositioned.
Frame
Validate
Click
MouseDown
MouseMove
MouseUp
Image
Line
ListBox
Click
DblClick
GotFocus
KeyDown
LostFocus
MouseDown
MouseMove
MouseUp
97
Button
Shift
X
Y
Button
Shift
X
Y
Button
Shift
X
Y
Click
DblClick
KeyPress
KeyUp
OLE
Cancel
Validate
Click
DblClick
GotFocus
KeyCode
Shift
KeyAscii
KeyCode
Shift
Button
Shift
X
Y
Button
Shift
X
Y
Button
Shift
X
Y
Cancel
Control
Events
KeyDown
KeyPress
KeyUp
LostFocus
ObjectMove
Resize
Parameters
KeyCode
Shift
KeyAscii
KeyCode
Shift
Comments
Left
Top
Width
Height
HeightNew
WidthNew
Updated
Code
changes.
Fired when objects
data has been
changed.
OptionButton
Validate
Click
DblClick
GotFocus
KeyDown
KeyPress
KeyUp
LostFocus
MouseDown
MouseMove
MouseUp
PictureBox
Validate
Click
GotFocus
KeyDown
KeyPress
KeyUp
LostFocus
MouseDown
MouseMove
98
Cancel
KeyCode
Shift
KeyAscii
KeyCode
Shift
Button
Shift
X
Y
Button
Shift
X
Y
Button
Shift
X
Y
Cancel
KeyCode
Shift
KeyAscii
KeyCode
Shift
Button
Shift
X
Y
Button
Shift
CCLAS 1.4
Control
Events
MouseUp
Validate
Shape
TextBox
Change
Click
DblClick
GotFocus
KeyDown
KeyPress
KeyUp
LostFocus
MouseDown
MouseMove
MouseUp
Timer
Validate
Timer
Parameters
X
Y
Button
Shift
X
Y
Cancel
Comments
KeyCode
Shift
KeyAscii
KeyCode
Shift
Button
Shift
X
Y
Button
Shift
X
Y
Button
Shift
X
Y
Cancel
Fired when the time
interval set has
elapsed.
Event
Change
Click
DblClick
GotFocus
KeyDown
KeyPress
KeyUp
LostFocus
MouseDown
99
Parameters
KeyCode
Shift
KeyAscii
KeyCode
Shift
Button
Comments
Control
Event
MouseMove
MouseUp
lstCombo
Validate
Click
KeyDown
KeyPress
KeyUp
mListBox
Validate
Click
KeyDown
KeyPress
KeyUp
mTextBox
UniComboBox
Validate
Change
Click
DblClick
KeyPress
Validate
Change
Click
DblClick
DropDown
GotFocus
KeyDown
KeyPress
KeyUp
UniListBox
LostFocus
Validate
Click
DblClick
GotFocus
KeyDown
KeyPress
KeyUp
LostFocus
MouseDown
MouseMove
100
Parameters
Shift
X
Y
Button
Shift
X
Y
Button
Shift
X
Y
Cancel
KeyCode
Shift
KeyAscii
KeyCode
Shift
Cancel
KeyCode
Shift
KeyAscii
KeyCode
Shift
Cancel
KeyAscii
Cancel
KeyCode
Shift
KeyAscii
KeyCode
Validate
Cancel
KeyCode
Shift
KeyAscii
KeyCode
Shift
Button
Shift
X
Y
Button
Comments
CCLAS 1.4
Control
Event
MouseUp
Validate
Change
Click
DblClick
GotFocus
KeyDown
UniTextBox
KeyPress
KeyUp
LostFocus
MouseDown
MouseMove
MouseUp
Validate
Parameters
Shift
X
Y
Button
Shift
X
Y
Cancel
Comments
KeyCode
Shift
KeyAscii
KeyCode
Shift
Button
Shift
X
Y
Button
Shift
X
Y
Button
Shift
X
Y
Cancel
Standalone scripts
These scripts must be fully specified because no objects have been exposed and made available for use. All
referenced objects must be created within the script. These scripts may be run:
o
Integrated scripts
These scripts are triggered at various points within the CCLAS EL modules.
Setup scripts
Staff scripts
101
Client scripts
Method scripts
Library management scripts
Processing scripts
Job scripts
Sample scripts
Batch scripts
Online scripts
MDE scripts
Report scripts
Production Report scripts
Invoice scripts
Taskman scripts
Management scripts
Audit scripts
Job Audit scripts
Status scripts
Sample Track scripts
QC scripts
SPC scripts
Lab Maintenance scripts
Revenue scripts
Consumables scripts
Dashboard scripts
102
CCLAS 1.4
User Screens
Most of the directories may use User Screens. These SCR files are automatically added to the Config
Directory during installation, and each of them belongs to a specific Module, for a specific purpose. If you
expect a user screen to appear during an action, and it does not appear, it is missing! Keep in mind that
version 1.2 have some of these user screens, version 1.4 have all these user screens.
Now, do not confuse User Screens with Custom Screens. Custom Screens are those that we script
ourselves, those which are not added to the CCLAS directories during installations!
Module
File
Staff
GroupingUser.SCR
Staff Staff Groups User Screen
Grouping.UserField1 to 5
103
Where is it used?
Module
File
Setup
GroupSectionUser.SCR
Where is it used?
InstrumentUser.SCR
Setup Instrument Codes User
Screen
Instrument.UserField1 to 20
LabUDF.VBS
Setup Lab Code
LabUser.SCR
Setup Lab Code User Screen
Lab.UserField1 to 20
104
CCLAS 1.4
Module
File
LOBUser.SCR
Setup Line of Business User
Screen
Lob.UserField1 to 5
SectionUser.SCR
Sectup Lab Sections User
Screen
Section.UserField1 to 20
StatusCodesUser.SCR
Setup Status Codes User
Screen
StatusCodes.UserField1 to 5
105
Where is it used?
Module
File
UnitUser.SCR
Setup Unit Codes User Screen
Unit.UserField1 to 20
CannedCommentsUser.SCR
Setup Canned Comments User
Screen
CannedComments.UserField1 to 5
Client
ClientContactUser.SCR
Client Contact User Screen
Client_Contact.UserField1 to 20
ClientCostUserQuery.SCR
Client bottom of Screen
106
Where is it used?
CCLAS 1.4
Module
File
ClientGroupUserQuery.SCR
Client Client Groups User
Screen
GroupClient.UserField1 to 5
ClientProjectUser.SCR
Client Project User Screen
Client_Project.UserField1 to 20
ClientQuoteUser.SCR
Client Quote User Screen
Client_Quote.UserField1 to 5
ClientUser.SCR
Client User Screen
Client.UserField1 to 20
107
Where is it used?
Module
File
ClientUserQuery.SCR
Client Bottom of screen
CostCentreUser.SCR
Client Cost Centre User Screen
GroupClientUser.SCR
Client Client Groups User
Screen
GroupClient.UserField1 to 5
Method
ProcRegAnalyteAddNew.SCR
(Only if the Scheme setting
CombinedSchemeAnalyteSelection is
enabled)
108
Where is it used?
CCLAS 1.4
Module
File
Where is it used?
ProcRegSchemeAddNew.SCR
ProcRegSchemeAnalyteUser.SCR
ProcRegSchemeUser.SCR
ProcReg_Scheme.UserFiel1 to 20
ProcRegUDF.VBS
109
Module
File
ProcRegUser.SCR
ProcReg.UserField1 to 20
ProcRegUserQuery.SCR
ProductAnalyteUser.SCR
Product_Analyte.UserField1 to 5
ProductUser.SCR
Product.UserField1 to 20
110
Where is it used?
CCLAS 1.4
Module
File
ProductUserQuery.SCR
QControlUser.SCR
QControl.UserField1 to 20
QCUserQuery.SCR
SchemeAnalyteUser.SCR
Scheme_Analyte.UserField1 to 20
111
Where is it used?
Module
File
SchemeUser.SCR
Scheme.UserField1 to 20
SchemeUserQuery.SCR
Job
PJCU.SCR
(Will only be available if the Profile
setting UserIdentsTab has been
defined)
ProfileUserQuery.SCR
112
Where is it used?
CCLAS 1.4
Module
File
ProfJobAddNew.SCR
ProfJobAnalyteAddNew.SCR
(Only if the Profile setting
CombinedSchemeAnalyteSelection is
enabled)
ProfJobCuidUser.SCR
ProfJobProcedureAddNew.SCR
113
Where is it used?
Module
File
ProfJobSchemeAddNew.SCR
ProfJobSchemeAnalyteUser.SCR
ProfJob_Scheme_Analyte .UserField1
to 20
ProfJobSchemeUser.SCR
ProfJob_Scheme.UserField1 to 20
ProfJobUser.SCR
114
Where is it used?
CCLAS 1.4
Module
File
Where is it used?
ProfJobUserIdents.SCR
(The Profile setting UserIdentsTab
defines which SCR file will be visible.)
ProSchemeAnalyteUDF.VBS
ProSchemeUDF.VBS
ProUDF.VBS
DBCUDF.VBS
Batch
BatchUDF.VBS
MDE
MDEUserQuery.SCR
MDESampleUserQuery.SCR
115
Module
File
Report
RepUserQuery.SCR
RepUDF.VBS
Where is it used?
Invoice
InvoiceUserQuery.SCR
InvoiceUser.SCR
InvUDF.VBS
Job Audit
AuditJobUserQuery.SCR
QC
PRFUDF.VBS
116
CCLAS 1.4
Module
File
STContainerUser.SCR
STJobSampleUser.SCR
STJob_Sample.UserFiel1 to 4
STJobUser.SCR
STJob.UserField1 to 4
117
Where is it used?
Module
File
Where is it used?
STLocationUser.SCR
STPhysicalTypeUser.SCR
STPhysicalType.UserField1 to 4
Lab
LabMaintScheduleUser.SCR
Maintenance
LabMaint_Schedule.UserField1 to 9
LabMaintUDF.VBS
LabMaintUser.SCR
LabMain.UserField1 to 5
118
CCLAS 1.4
Module
File
Where is it used?
Consumables CMConsumeTypeUser.SCR
CMConsume_Type.UserField1 to 5
CMConsumeUser.SCR
CMConsume.UserField1 to 5
CMSupplierUser.SCR
CMSupplier.UserField1 to 5
<module>UserQuery.SCR
Scheme codes, product codes, procedures and QC codes in the Method module, client groups, client codes
and cost centres in the Client module, jobs in the Job module, jobs in the Data Entry module, jobs in the
Report module, jobs in the Production Report module, jobs in the Invoice module, jobs in the Job Audit
119
module, samples in the Sample Track module, and library management schemes and procedures in the
Library Management module all support the user of UserQuery.SCR files to provide a customised for used to
return a filtered list of items.
If the module node initialization setting LoadBrowser is disabled, the module node displays the screen file
ModuleNodeUserQuery.SCR to return a filtered list of items, making the Properties menu option
automatically disabled since filtering is now under control of the user query script file.
Each of these module nodes has a QueryEvent program initialization setting that defines the name of the
user query control and the event that is looked for to initiate the database query to return the lists of items for
that node, e.g., cmdQuery_Click.
Each UserQuery.SCR file must have a command button with the exact same name as the user query control
name.
'COMMANDBUTTON,cmdQuery,,Query,Query data using entered criteria,105,255,600,600,%pictureDirectory
%\Find.ICO,,,,,,
Each UserQuery.SCR file must have an event method with the exact same name as the user query control
event.
'----------------------------------------------------------------------------------' Click selected
'----------------------------------------------------------------------------------Sub cmdQuery_Click()
End Sub
Each UserQuery.SCR file must have a function method to build up the SQL Where clause used to filter the
list of items to be returned.
'----------------------------------------------------------------------------------' Build where clause for query
'----------------------------------------------------------------------------------Function SQLWhere()
Dim sFieldWhere
SQLWhere = ""
End Function
Each UserQuery.SCR file may have an optional function method to build up the SQL Order clause used to
order the list of items to be returned.
'----------------------------------------------------------------------------------' Build Order by clause for query
'----------------------------------------------------------------------------------Function SQLOrder()
Dim sFieldOrder
SQLOrder = ""
End Function
As an example, the Client module is the first module where we will be looking at one of the User Query
screens. The ClientUserQuery.SCR is located in the Config directory, and is copied to the Server during
installation.
The Client Module may be viewed in a few different ways:
If the ClientApp settings LoadBrowser (in the Staff Module) is set to disabled, the screen would look like this:
120
CCLAS 1.4
But if the LoadBrowser setting is set to enabled, the Client Module will look like this:
The screen at the top shows the ClientUserQuery.SCR at the bottom of the Client list.
The appearance of most of the Modules can be controlled in this way. The SCR file corresponding to each
Module, may be changed to suit the needs of the laboratory, through VB Script.
121
A list of the User Query screens that work in the same fashion, are the following:
Module
Screen name
Client
ClientUserQuery.SCR
ClientApp LoadBrowser=disabled
ClientCostUserQuery.SCR
ClientGroupUserQuery.SCR
Method
ProcRegUserQuery.SCR
ProductUserQuery.SCR
QCUserQuery.SCR
Profile (Job) ProfileUserQuery.SCR
MDE
MDEUserQuery.SCR
Report
RepUserQuery.SCR
Invoice
InvoiceUserQuery.SCR
Job Audit
JobAuditUserQuery.SCR
Sample
SamTrackUserQuery.SCR
Track
SamTrackAddUserQuery.SCR
Sub Form_Load()
.
.
End Sub
'---------------Sub cmdQuery_Click()
.
.
End Sub
'---------------Function SQLWhere()
.
.
End Function
'---------------Function SQLOrder()
.
.
End Function
'---------------Function FieldWhereString(ByVal sField, yVal sValue)
.
.
End Function
'----------------
122
CCLAS 1.4
Cli_Code
FROM
Client
WHERE
Cli_Code LIKE B%
The <module>UserQuery.SCR files work like filters, and if it exists in your setup, but is not used, all criteria
are satisfied and you will see a complete list of whatever the Module represents.
Let us have a look at each of the <module>UserQuery.SCR files:
ClientUserQuery.SCR
If the ClientApp initialization setting LoadBrowser is disabled and the file ClientUserQuery.scr exists, the form
on this screen is used to fill out conditions on which to return client codes to populate the browser list.
Otherwise, the regular client browser is used.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Sub SQLWhere()
Sub SQLOrder()
Objects exposed from Client.exe for use in this script:
Form
clsArray
clsSecurity
clsBDClient
123
ClientCostUserQuery.SCR
If the ClientApp initialization setting LoadBrowser is disabled and the file ClientCostUserQuery.scr exists, the
form on this screen is used to fill out conditions on which to return client cost codes to populate the browser
list. Otherwise, the regular cost code browser is used.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Sub SQLWhere()
Sub SQLOrder()
Objects exposed from Client.exe for use in this script:
Form
clsArray
clsSecurity
clsBDCostcentre
ClientGroupUserQuery.SCR
If the ClientApp initialization setting LoadBrowser is disabled and the file ClientGroupUserQuery.scr exists,
the form on this screen is used to fill out conditions on which to return client group codes to populate the
browser list. Otherwise, the regular client group browser is used.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Sub SQLWhere()
Sub SQLOrder()
Objects exposed from Client.exe for use in this script:
Form
clsArray
clsSecurity
clsBDClient
ProcRegUserQuery.SCR
If the SchemeApp initialization setting LoadBrowser is disabled and the file ProcregUserQuery.scr exists, the
form on this screen is used to fill out conditions on which to return procedure codes to populate the browser
list. Otherwise, the regular procedure browser is used.
Subroutines run from this script:
124
CCLAS 1.4
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Sub SQLWhere()
Sub SQLOrder()
Objects exposed from Scheme.exe for use in this script:
Form
clsArray
clsSecurity
clsBDProcreg
PVExplorer
ProductUserQuery.SCR
If the SchemeApp initialization setting LoadBrowser is disabled and the file ProductUserQuery.scr exists, the
form on this screen is used to fill out conditions on which to return product codes to populate the browser list.
Otherwise, the regular product browser is used.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Sub SQLWhere()
Sub SQLOrder()
Objects exposed from Scheme.exe for use in this script:
Form
clsArray
clsSecurity
clsBDProduct
125
QCUserQuery.SCR
If the SchemeApp initialization setting LoadBrowser is disabled and the file QCUserQuery.scr exists, the
form on this screen is used to fill out conditions on which to return quality control codes to populate the
browser list. Otherwise, the regular quality control browser is used.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Sub SQLWhere()
Sub SQLOrder()
Objects exposed from Scheme.exe for use in this script:
Form
clsArray
clsSecurity
clsBDQControl
ProfileUserQuery.SCR
If the Profile initialization setting LoadBrowser is disabled and the file ProfileUserQuery.scr exists, the form
on this screen is used to fill out conditions on which to return job numbers to populate the browser list.
Otherwise, the regular job browser is used.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Sub SQLWhere()
Sub SQLOrder()
Objects exposed from Profile.exe for use in this script:
Form
clsArray
clsSecurity
clsBDClient
clsBDProfjob
PVExplorer
126
CCLAS 1.4
SchemeUserQuery.SCR
If the SchemeApp initialization setting LoadBrowser is disabled and the file SchemeUserQuery.scr exists, the
form on this screen is used to fill out conditions on which to return scheme codes to populate the browser
list. Otherwise, the regular scheme browser is used.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Sub SQLWhere()
Sub SQLOrder()
Objects exposed from Scheme.exe for use in this script:
Form
clsArray
clsSecurity
clsBDScheme
MDEUserQuery.SCR
If the MDE initialization setting LoadBrowser is disabled and the file MDEUserQuery.scr exists, the form on
this screen is used to fill out conditions on which to return job numbers to populate the browser list.
Otherwise, the regular job browser is used.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Sub SQLWhere()
Sub SQLOrder()
Objects exposed from MDE.exe for use in this script:
Form
clsArray
clsSecurity
clsBDClient
clsBDProfjob
PVExplorer
127
MDESampleUserQuery.SCR
If the MDE initialization setting LoadBrowser is disabled and the file MDESampleUserQuery.scr exists, the
form on this screen is used to fill out conditions on which to return samples to populate the browser list.
Otherwise, the regular job browser is used.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Sub SQLWhere()
Sub SQLOrder()
Objects exposed from xMDE.exe for use in this script:
Form
clsArray
clsSecurity
clsBDClient
clsBDProfjob
PVExplorer
RepUserQuery.SCR
If the Report initialization setting LoadBrowser is disabled and the file RepUserQuery.scr exists, the form on
this screen is used to fill out conditions on which to return job numbers to populate the browser list.
Otherwise, the regular job browser is used.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Sub SQLWhere()
Sub SQLOrder()
Objects exposed from Report.exe for use in this script:
Form
clsArray
clsSecurity
clsBDClient
clsBDProfjob
PVExplorer
128
CCLAS 1.4
InvoiceUserQuery.SCR
If the Invoice initialization setting LoadBrowser is disabled and the file InvoiceUserQuery.scr exists, the form
on this screen is used to fill out conditions on which to return job numbers to populate the browser list.
Otherwise, the regular job browser is used.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Sub SQLWhere()
Sub SQLOrder()
Objects exposed from Invoice.exe for use in this script:
Form
clsArray
clsSecurity
clsBDClient
clsBDProfjob
PVExplorer
AuditJobUserQuery.scr
If the AuditJob initialization setting LoadBrowser is disabled and the file AuditJobUserQuery.scr exists, the
form on this screen is used to fill out conditions on which to return job numbers to populate the browser list.
Otherwise, the regular job browser is used.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Sub SQLWhere()
Sub SQLOrder()
Objects exposed from AuditJob.exe for use in this script:
Form
clsArray
clsSecurity
clsBDClient
clsBDProfjob
PVExplorer
129
SamTrackUserQuery.SCR
If the SampleTrack initialization setting LoadBrowser is disabled and the file SamTrackUserQuery.scr exists,
the form on this screen is used to fill out conditions on which to return job numbers which are being tracked
to populate the browser list. Otherwise, the regular job browser is used.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Sub SQLWhere()
Sub SQLOrder()
Objects exposed from SampleTrack.exe for use in this script:
Form
clsArray
clsSecurity
clsBDClient
clsBDProfjob
SamTrackAddUserQuery.scr
When the New menu option is selected, if the file SamTrackAddUserQuery.scr exists, the form on this screen
is used to fill out conditions on which to return job numbers to start tracking on to populate the browser list.
Otherwise, the regular job browser is used.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Sub SQLWhere()
Sub SQLOrder()
Objects exposed from SampleTrack.exe for use in this script:
Form
clsArray
clsSecurity
clsBDClient
clsBDProfjob
130
CCLAS 1.4
<module>User.SCR
These SCR files, or screens, exist in various modules to populate the <tablename>.UserFieldn in most of the
CCLAS tables. Should the user wich to add additional information, these are being used.
We will look at the following SCR files:
Module
Screen name
Description
Staff
GroupingUser.SCR
Setup
GroupSectionUser.SCR
Setup
InstrumentUser.SCR
Setup
LabUser.SCR
Setup
LobUser.SCR
Setup
SectionUser.SCR
Setup
StatusCodesUser.SCR
Setup
UnitUser.SCR
Setup
CannedCommentsUser.SCR
Client
ClientContactUser.SCR
Client
ClientProjectUser.SCR
Client
ClientQuoteUser.SCR
Client
ClientUser.SCR
Client
CostCentreUser.SCR
Client
GroupClientUser.SCR
Method
ProcRegSchemeAnalyteUser.SCR
Method
ProcRegSchemeUser.SCR
Method
ProcRegUser.SCR
Method
ProductAnalyteUser.SCR
Method
ProductUser.SCR
Method
QControlUser.SCR
131
Module
Screen name
Description
Method
SchemeAnalyteUser.SCR
Method
SchemeUser.SCR
Profile
ProfJobSchemeAnalyteUser.SCR
Profile
ProfJobSchemeUser.SCR
Lab
LabMaintScheduleUser.SCR
Maintenance
Lab
LabMaintUser.SCR
Maintenance
Consumables CMConsumeTypeUser.SCR
Consumables CMConsumeUser.SCR
Consumables CMSupplierUser.SCR
GroupingUser.SCR
This is the Staff group user fields screen script. Pressing the User screen button on the Staff group form
runs the GroupingUser.SCR script file. This allows for the editing of Grouping table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Config.exe for use in this script:
clsArray
clsSecurity
132
CCLAS 1.4
clsBDGrouping
GroupSectionUser.SCR
This is used to add additional information to the Section Groups in the Setup module. Pressing the User
screen button on the Section group form runs the GroupSectionUser.SCR script file. This allows for the
editing of GroupSection table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
133
InstrumentUser.SCR
This file is used to add additional information to Instruments in the Setup module. Pressing the User screen
button on the Instrument form runs the InstrumentUser.SCR script file. This allows for the editing of
Instrument table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Config.exe for use in this script:
Form
clsArray
clsSecurity
clsBDInstrument
LabUser.SCR
Used in the Setup Module to add additional information to Lab. Pressing the User screen button on the Lab
form runs the LabUser.SCR script file. This allows for the editing of Lab table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Config.exe for use in this script:
Form
clsArray
clsSecurity
clsBDLab
LobUser.SCR
Used to add extra information to the Lob table. Pressing the User screen button on the LOB form runs the
LOBUser.SCR script file. This allows for the editing of LOB table user fields.
134
CCLAS 1.4
SectionUser.SCR
Pressing the User screen button on the Section form runs the SectionUser.SCR script file. This allows for the
editing of Section table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Config.exe for use in this script:
Form
clsArray
clsSecurity
clsBDSection
StatusCodesUser.SCR
Pressing the User screen button on the Status codes form runs the StatuscodesUser.SCR script file. This
allows for the editing of Statuscodes table user fields.
Subroutines run from this script:
Sub Form_Load()
Form_Unload()
Form_Save()
Form_Resize()
Objects exposed from Config.exe for use in this script:
Form
clsArray
clsSecurity
clsBDStatuscodes
135
UnitUser.SCR
Pressing the User screen button on the Units codes form runs the UnitUser.SCR script file. This allows for
the editing of Unit table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Config.exe for use in this script:
Form
clsArray
clsSecurity
clsBDUnit
CannedCommentsUser.SCR
Pressing the User screen button on the Canned comment codes form runs the CannedcommentsUser.SCR
script file. This allows for the editing of Statuscodes table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Config.exe for use in this script:
Form
clsArray
clsSecurity
clsBDCannedcomments
ClientContactUser.SCR
Pressing the User screen button on the Client contact form runs the ClientContactUser.SCR script file. This
allows for the editing of Client_Contact table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
136
CCLAS 1.4
ClientProjectUser.SCR
Pressing the User screen button on the Client project form runs the ClientProjectUser.SCR script file. This
allows for the editing of Client_Project table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Client.exe for use in this script:
Form
clsArray
clsSecurity
clsBDClient
ClientQuoteUser.SCR
Pressing the User screen button on the Client quote form runs the ClientQuoteUser.SCR script file. This
allows for the editing of Client_Quote table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Client.exe for use in this script:
Form
clsArray
clsSecurity
clsBDClient
ClientUser.SCR
Pressing the User screen button on the Client form runs the ClientUser.SCR script file. This allows for the
editing of Client table user fields.
137
CostCentreUser.SCR
Pressing the User screen button on the Client cost centre form runs the CostcentreUser.SCR script file. This
allows for the editing of CostCentre table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Client.exe for use in this script:
Form
clsArray
clsSecurity
clsBDCostCentre
GroupClientUser.SCR
Pressing the User screen button on the Client group form runs the GroupClientUser.SCR script file. This
allows for the editing of GroupClient table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Client.exe for use in this script:
Form
clsArray
clsSecurity
clsBDClient
138
CCLAS 1.4
ProcRegSchemeAnalyteUser.SCR
Pressing the User screen button on the Procedure scheme analyte form runs the
ProcregSchemeAnalyteUser.SCR script file. This allows for the editing of Procreg_Scheme_Analyte table
user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Scheme.exe for use in this script:
Form
clsArray
clsSecurity
clsBDProcreg
ProcRegSchemeUser.SCR
Pressing the User screen button on the Procedure scheme form runs the ProcregSchemeUser.SCR script
file. This allows for the editing of Procreg_Scheme table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Scheme.exe for use in this script:
Form
clsArray
clsSecurity
clsBDProcreg
ProcRegUser.SCR
Pressing the User screen button on the Procedure form runs the ProcregUser.SCR script file. This allows for
the editing of Procreg table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
139
ProductAnalyteUser.SCR
Pressing the User screen button on the Product analyte form runs the ProductAnalyteUser.SCR script file.
This allows for the editing of Product_Analyte table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Scheme.exe for use in this script:
Form
clsArray
clsSecurity
clsBDProductAnalyte
ProductUser.SCR
Pressing the User screen button on the Product form runs the ProductUser.SCR script file. This allows for
the editing of Product table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Scheme.exe for use in this script:
Form
clsArray
clsSecurity
clsBDProduct
QControlUser.SCR
Pressing the User screen button on the QC form runs the QControlUser.SCR script file. This allows for the
editing of QControl table user fields.
140
CCLAS 1.4
SchemeAnalyteUser.SCR
Pressing the User screen button on the Scheme analyte form runs the SchemeAnalyteUser.SCR script file.
This allows for the editing of Scheme_Analyte table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Scheme.exe for use in this script:
Form
clsArray
clsSecurity
clsBDScheme
SchemeUser.SCR
Pressing the User screen button on the Scheme form runs the SchemeUser.SCR script file. This allows for
the editing of Scheme table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Scheme.exe for use in this script:
Form
clsArray
clsSecurity
clsBDScheme
141
ProfJobCuidUser.SCR
Double-clicking a sample on the Grid/sample info tab form runs the ProfjobCuidUser.SCR script file. This
allows for the editing of Profjob_Cuid table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Profile.exe for use in this script:
Form
clsArray
clsSecurity
clsCurrent
clsBDScheme
clsBDClient
clsBDProfjob
ProfJobSchemeAnalyteUser.SCR
Pressing the User screen button on the Job scheme analyte form runs the ProfjobSchemeAnalyteUser.SCR
script file. This allows for the editing of Profjob_Scheme_Analyte table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Profile.exe for use in this script:
Form
clsArray
clsSecurity
clsBDProfjob
ProfJobSchemeUser.SCR
Pressing the User screen button on the Job scheme form runs the ProfjobSchemeUser.SCR script file. This
allows for the editing of Profjob_Scheme table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
142
CCLAS 1.4
ProfJobUser.SCR
Pressing the User screen button on the Job form runs the ProfjobUser.SCR script file. This allows for the
editing of Profjob table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Profile.exe for use in this script:
Form
clsArray
clsSecurity
clsCurrent
clsBDScheme
clsBDClient
clsBDProfjob
STJobUser.SCR
Pressing the User screen button on the sample track job form will run the STJobUser.SCR script file. This is
used to allow for the editing of sample track job details user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from SampleTrack.exe for use in this script:
Form
clsArray
clsSecurity
clsCurrent
clsBDStjob
143
STJobSampleUser.SCR
Pressing the User screen button on the sample track job sample form will run the STJobSampleUser.SCR
script file. This is used to allow for the editing of sample track job sample details user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from SampleTrack.exe for use in this script:
Form
clsArray
clsSecurity
clsCurrent
clsBDStjobsample
STPhysicalTypeUser.SCR
Pressing the User screen button on the sample track physical type form will run the
STPhysicalTypeUser.SCR script file. This is used to allow for the editing of sample track physical type details
user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from SampleTrack.exe for use in this script:
Form
clsArray
clsSecurity
clsCurrent
clsBDStphysicaltype
InvoiceUser.SCR
If the file InvoiceUser.SCR script file exists, clicking on the Userfields tab runs this file. This allows for the
editing of InvoiceUser table user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
144
CCLAS 1.4
LabMaintScheduleUser.SCR
Pressing the User screen button on the lab maintenance schedule form will run the
LabmaintScheduleUser.SCR script file. This is used to allow for the editing of lab maintenance schedule user
fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from LabMaintenance.exe for use in this script:
Form
clsArray
clsSecurity
clsLabMaintenance
clsBDLabmaint
clsBDLabmaintaudit
clsBDInstrument
fso
ts
LabMaintUser.SCR
Pressing the User screen button on the lab maintenance form will run the LabmaintUser.SCR script file. This
is used to allow for the editing of lab maintenance task user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
145
CMConsumeUser.SCR
Pressing the User screen button on the consumable form will run the CMConsumeUser.SCR script file. This
is used to allow for the editing of consumable user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Consumables.exe for use in this script:
Form
clsArray
clsSecurity
clsBDCmconsume
clsBDCmConsumeType
clsBDCmSupplier
fso
ts
CMConsumeTypeUser.SCR
Pressing the User screen button on the consumable type form will run the CMConsumeTypeUser.SCR script
file. This is used to allow for the editing of consumable type user fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Consumables.exe for use in this script:
Form
clsArray
146
CCLAS 1.4
clsSecurity
clsBDCmconsume
clsBDCmConsumeType
clsBDCmSupplier
fso
ts
CMConsumeSupplier.SCR
Pressing the User screen button on the consumable supplier form will run the
CMConsumeSupplierUser.SCR script file. This is used to allow for the editing of consumable supplier user
fields.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Consumables.exe for use in this script:
Form
clsArray
clsSecurity
clsBDCmconsume
clsBDCmConsumeType
clsBDCmSupplier
fso
ts
*UDF.VBS
The VBS scripts that end in *UDF.VBS, are VB Scripts that one may customize to control the behaviour of
Modules through scripting. These scripts are very versatile, and we will be looking deeper into these scripts
than we did for the <module>UserQuery.SCR scripts.
During installation of CCLAS, the following *UDF.VBS scripts are automatically copied to the Config
directory:
Module
Screen name
Description
Setup
LabUDF.VBS
Method
ProcRegUDF.VBS
147
Module
Screen name
Description
Profile
ProSchemeAnalyteUDF.VBS
Profile
ProSchemeUDF.VBS
Profile
ProUDF.VBS
DbcUDF.VBS
Batch
BatchUDF.VBS
Report
RepUDF.VBS
PRepUDF.VBS
Invoice
InvUDF.VBS
Status
StatUDF.VBS
QC
PrfUDF.VBS
Lab Maint
LabMaintUDF.VBS
LabUDF.VBS
After a new lab code is added, if the file LabUDF.vbs exists, the AfterAddLab subroutine in it is run.
148
CCLAS 1.4
The LabUDF.VBS will fire after the user adds or deletes a new Lab Code. In the example above, nothing
special happens after a new Lab Code has been created. The following sub is empty:
Sub AfterAddLab(ByVal sLabCode)
'
End Sub
But not that, when the user deletes a lab, two things happen:
Sub AfterDeleteLab(ByVal sLabCode)
BackupLabCode sLabCode
DeleteLabCode sLabCode
End Sub
A backup is made of the data that exist in the Lab you are deleting, and the Lab Code is deleted.
ProcRegUDF.VBS
The ProcRegUDF.VBS is fired after a Scheme has been added to a Procedure. This script will only fire if the
ProcReg setting CombinedSchemeAnalyteSelection is set to enabled. The installed code looks like this:
Option Explicit
'
Sub SchemeUpdated(sSchCode, lSchVersion, bAddScheme, bAddAnalyte, sTaskNumber)
'
514 => Refresh with save
'
600 => Save
'
900 => Scheme record updated (double-clicked on scheme)
'
901 => Analyte record updated (double-clicked on analyte)
End Sub
The objects that are exposed in this script, are the clsBDProcReg and clsSecurity classes. In Sub
SchemeUpdated() , not that there are comments relating to codes one may use for certain effects. The
sTaskNumber variable is a parameter which the script receives from the action the user performs that
means that the script will only fire under one of these four conditions.
Let us take an example:
Suppose we create a Procedure with specific Schemes in it. According to a Stream table (table containing
user specific data), there are at least four types of samples received at the laboratory which are being
149
analysed with exactly the same group of Methods. We can now use the ProcRegUDF.VBS script to
automatically create the other Procedures which correspond to those types of Samples, based on specific
rules.
ProSchemeAnalyteUDF.VBS
After adding a new analyte to a scheme in a lab batch job, if the file ProSchemeAnalyteUDF.VBS exists, the
ProSchemeAnalyteUDF1 subroutine in it is run.
What can you do with a script like this? Suppose you have a separate list of Analytes and whether they are
report active for specific types of Jobs or not, regardless of how they are specified in the Method module, in
a TXT file. Using queries and more scripting inside this file, you look whether the type of Job satisfies the
reporting criteria. If not, you change the reportactive field in the ProfJob_Scheme_Analyte table according to
what is written in the TXT file!
ProSchemeUDF.VBS
After adding a new scheme to LB job scripts
After adding a new scheme to a lab batch job, if the file ProSchemeUDF.vbs exists, the ProSchemeUDF1
subroutine in it is run.
150
CCLAS 1.4
How can I use it? Maybe there is a specific order in which Schemes should appear in the Job use this to
change it automatically!
ProUDF.VBS
Before copying a job scripts
Before a job is copied, if the file ProUDF.vbs exists, the ProUDF20 or BeforeJobCopy subroutine in it is run
(whichever is listed first in the script file).
Subroutines run from this script:
Sub ProUDF20()
Sub BeforeJobCopy()
Objects exposed from Profile.exe for use in this script:
clsArray
clsSecurity
clsBDProfjob
151
152
CCLAS 1.4
153
154
CCLAS 1.4
155
156
CCLAS 1.4
157
158
CCLAS 1.4
159
160
CCLAS 1.4
'
Sub
.
.
End
'
Sub
.
.
End
'
Sub
.
.
End
Suppose you want to hide certain tabs in the Job module from Staff Codes that do not belong to a certain
group, and where Access Levels would not be useful at what stage would one write the code to to that?
Maybe in the BeforeJobEdit sub?
Or you would like to immediately Batch samples that belong to a specific kind of Job, the moment the
Samples have been registered?
Or maybe automatically send an email to Clients informing them that their Samples have been registered?
The possibilities are huge.
Or would you like to generate a summary sheet and email it to the Client automatically?
DBCUDF.VBS
Before creating PJCSA records scripts
Before creating the sample scheme analyte determination records for a job, if the file DbcUDF.vbs exists, the
DbcUDF1 or BeforeCreateConcDB subroutine in it is run (whichever is listed first in the script file).
Subroutines run from this script:
Sub DbcUDF1()
Sub BeforeCreateConcDB()
Objects exposed from ccProf01.dll for use in this script:
clsSecurity
clsBDScheme
clsBDClient
clsBDProfjob
clsExpandIdent
clsProfRep
161
BatchUDF.VBS
Before creating a lab batch scripts
Before creating a lab batch, if the file BatchUDF.vbs exists, the BatchUDF1 subroutine in it is run for the new
lab batch job.
Subroutines run from this script:
Sub DbcUDF1(sProJob)
Objects exposed from ccProf01.dll for use in this script:
clsSecurity
clsBDScheme
clsBDClient
clsBDProfjob
162
CCLAS 1.4
In the BatchUDF1 Sub, nothing special happens but in the BatchUDF2, a few other subs are called):
Sub
.
.
End
'
Sub
.
.
End
'
Sub
.
.
End
'
Sub
.
.
163
CreateAALabelFile(sProJob)
Sub
CreateWorkSheet(sProJob)
Sub
ReSequence(sProJob)
Sub
ShortBarcodesForLeco(sProJob)
End Sub
'
Sub AddQCValues(sProJob)
.
.
End Sub
Do you need to create a label file to feed directly to the instrument, as soon as the Lab Batch has been
created?
Or create a Worksheet automatically, so that the person that does the batching, does not have to generate
paperwork manually?
Maybe re-sequence samples due to some reason?
Would you like to generate shorter barcodes for an instrument that cannot accept longer CCLAS Sample
Idents?
Or add dilutions and aliquots to STDs in the Lab Batch?
RepUDF.VBS
Before opening job scripts
Before a job is opened, if the file RepUDF.vbs exists, the BeforeOpenJob subroutine in it is run.
Subroutines run from this script:
Sub BeforeOpenJob()
Objects exposed from Report.exe for use in this script:
clsArray
clsSecurity
clsBDProfjob
164
CCLAS 1.4
165
'
'
Objects exposed for this subroutine
'
Form
'
clsBDProfJob
'
clsSecurity
'
End Sub
Would you like to automatically place your Report on the Companys intranet? Maybe convert it with Java?
Or are there other systems that depend on data from your report maybe they would allow you to place the
reported data directly into tables allocated by those systems?
Or add another field to the Excel template based on certain criteria?
Automatically print the report in PDF format?
Protect the worksheet so that no unauthorized changes can be made?
Or create a unique report number for e.g. Final Metals only?
PRepUDF.VBS
Before creating an analytical Excel report scripts
Before an analytical Excel report is generated for the job (i.e., when the selected template has .XLS file
extension), if the file PRepUDF.vbs exists, the PRepUDF1 subroutine in it is run.
Subroutines run from this script:
Sub PRepUDF1()
Objects exposed from ccPRep01.dll for use in this script:
clsBDScheme
clsBDClient
clsBDProfjob
Parameters
clsProfRep
Excel application
166
CCLAS 1.4
167
InvUDF.VBS
Before opening a job scripts
Before opening a single job that does not yet have an invoice, opening multiple jobs that do not yet have an
invoice, editing an invoice, overwriting an invoice or opening a job to issue another invoice for it, if the file
InvUDF.vbs exists, the InvUDF5 or CanEditInvoice subroutine in it is run (whichever is listed first in the script
file).
Subroutines run from this script:
Sub InvUDF5()
Sub CanEditInvoice()
Objects exposed from Invoice.exe for use in this script:
clsArray
clsSecurity
clsInvoice
After querying data and the cost items grid is loaded scripts
After querying data and the cost items grid is loaded on the Details tab, if the file InvUDF.vbs exists, the
InvUDF4 or AfterRefreshData subroutine in it is run (whichever is listed first in the script file).
Subroutines run from this script:
Sub InvUDF4()
Sub AfterRefreshData()
Objects exposed from Invoice.exe for use in this script:
clsArray
clsSecurity
clsInvoice
168
CCLAS 1.4
1
2
3
4
5
6
7
8
9
PRO_JOB
SCH_CODE
ANALYTECODE
INVMESSAGE1
NOANALYTES
NOSAMPLES
UNITPRICE
DISCOUNT
AMOUNT
169
170
CCLAS 1.4
171
172
CCLAS 1.4
Suppose you want to automatically email the Invoice to your Client after it has been created?
Or you assign a different sequence number to each Clients invoices?
Or send the invoice amount to some accounting system?
StatUDF.VBS
Before querying records for a Crystal Report scripts
Before querying records to generate a Crystal Report status report (i.e., when the selected template has
.RPT file extension), if the file StatUDF.vbs exists, the BeforeCrystalQuery subroutine in it is run.
Subroutines run from this script:
Sub BeforeCrystalQuery()
Objects exposed from StatRep.exe for use in this script:
clsArray
clsSecurity
clsBDProfjob
clsProfRep
clsStatRep
173
Sub
.
.
End
'
Sub
.
.
End
BeforeCrystalGenerate()
Sub
AfterCrystalGenerate()
Sub
PrfUDF.VBS
The PRFUDF.VBS handles user-defined QC Report creation.
174
CCLAS 1.4
175
176
CCLAS 1.4
Sub PrfUDF4()
.
.
End Sub
Sub PrfUDF5()
.
.
End Sub
Sub PrfUDF6()
.
.
End Sub
What can you do with all of this? Create QC Report and graphs automaticall and email them to the relevant
people!
Or update tables from other systems that need Quality Control data?
Or, maybe use this data for calibration of an instrument, sending it to the relevant database on the
Instruments PC?
LabMaintUDF.VBS
The LabMaintUDF.VBS handles user defined Laboratory Maintenance tasks. During installation, this file is in
the following format:
Sub LabUDF1()
'
' Pre audit add subrountine
'
End Sub
Sub LabUDF2()
'
' Post audit add subrountine
'
End Sub
Sub LabUDF3()
'
' Pre schedule modify subroutine
'
End Sub
'
Sub LabUDF4()
'
' Post schedule modify subroutine
'
End Sub
177
*Runn Settings
ConsumablesRunn
If the File Run menu is selected, the associated screen script defined by the Consumables initialization
settings ConsumablesRunn is run to add a new tracking.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Consumables.exe for use in this script:
Form
clsArray
clsSecurity
clsBDCmConsumeType
clsBDCmSupplier
fso
ts
MDERunn
If the MDERun run type menu is selected, the associated screen script defined by the MDE initialization
settings MDERunn is run to add a new run list.
Subroutines run from this script:
Sub Form_Load()
Objects exposed from Samana.exe for use in this script:
Form,
clsArray
clsSecurity
clsBDProfjob
Grid
F1Book1
SamanaRunn
If the File Add run type menu is selected, the associated screen script defined by the Samana initialization
settings SamanaRunn is run to add a new run list.
178
CCLAS 1.4
Profile - ScreenFilen
If the File New job type menu is selected, the associated screen script defined by the Profile initialization
settings ProfileScreenFilen is run to add a new job.
Subroutines run from this script:
Sub Form_Load()
Sub Main()
Objects exposed from Profile.exe for use in this script:
Form
clsArray
clsSecurity
clsProfile
clsBDProfjob
clsCurrent
SamReg - ScreenFilen
If the File New sample type menu is selected, the associated screen script (default script is SamReg.scr) is
run to register a new sample for a job. The values of the SamReg initialization settings ScreenFilen point to
screen files that are used to enter user defined details for different sample types.
Subroutines run from this script:
Sub Form_Load()
Form_Unload()
Form_Save()
Form_Resize()
179
Taskman - AutoRunn
Either when a script is manually selected or when there is an associated screen script defined by the
Taskman initialization setting AutoRunn, the Taskman module runs the script.
Subroutines run from this script:
Sub Main()
Objects exposed from Taskman.exe for this script:
clsSecurity
clsBOTaskmanSession
fso
ts
LabMaintenanceRunn
If the File Run menu is selected, the associated screen script defined by the LabMaintenance initialization
settings LabMaintenanceRunn is run to add a new lab maintenance schedule.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from LabMaintenance.exe for use in this script:
Form
clsArray
clsSecurity
clsBDLabmaint
clsBDLabmaintaudit
clsLabMaintenance
clsBDInstrument
fso
ts
180
CCLAS 1.4
SampleTrackRunn
If the File Run menu is selected, the associated screen script defined by the SampleTrack initialization
settings SampleTrackRunn is run to add a new tracking.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from SampleTrack.exe for use in this script:
Form
clsArray
clsSecurity
clsBDSTPhysicalType
clsBDSTLocation
clsBDSTContainer
clsBDSTAction
clsBDSTJob
clsBDProfjob
clsBDProfClient
clsBDClient
fso
ts
ConsumablesRunn
If the File Run menu is selected, the associated screen script defined by the Consumables initialization
settings ConsumablesRunn is run to add a new tracking.
Subroutines run from this script:
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from Consumables.exe for use in this script:
Form
clsArray
clsSecurity
clsBDCmConsumeType
clsBDCmSupplier
fso
ts
181
*AddNew.SCR
ProcregSchemeAddNew.scr
When selecting a scheme to add to a procedure, if the file ProcregSchemeAddNew.scr exists, the form is
run. This form can be used return a scheme code to be added to the procedure.
Subroutines run from this script:
Sub Form_Load()
Sub SQLWhere()
Sub SQLOrder()
Sub cmdQuery_Click()
Objects exposed from Scheme.exe for use in this script:
clsArray
clsSecurity
clsBDScheme
ProductSchemeAddNew.scr
When selecting a scheme to add to a product, if the file ProductSchemeAddNew.scr exists, the form is run.
This form can be used return a scheme code to be added to the product.
Subroutines run from this script:
Sub Form_Load()
Sub SQLWhere()
Sub SQLOrder()
Sub cmdQuery_Click()
Objects exposed from Scheme.exe for use in this script:
clsArray
clsSecurity
clsBDScheme
ProfjobAddNew.scr
If the New menu icon is selected, the ProfjobAddNew.scr script is run.
Subroutines run from this script:
Sub Form_Load()
Sub SQLWhere()
Sub SQLOrder()
Sub cmdQuery_Click()
182
CCLAS 1.4
ProfjobProcedureAddNew.scr
When selecting a procedure to add to a job, if the file ProfjobProcedureAddNew.scr exists, the form is run.
This form can be used return a procedure code to be added to the job.
Subroutines run from this script:
Sub Form_Load()
Sub SQLWhere()
Sub SQLOrder()
Sub cmdQuery_Click()
Objects exposed from Scheme.exe for use in this script:
Form object
clsArray
clsSecurity
clsBDProcreg
clsBDProfjob
ProfjobSchemeAddNew.scr
When selecting a scheme to add to a job, if the file ProfjobSchemeAddNew.scr exists, the form is run. This
form can be used return a scheme code to be added to the job.
Subroutines run from this script:
Sub Form_Load()
Sub SQLWhere()
Sub SQLOrder()
Sub cmdQuery_Click()
Objects exposed from Scheme.exe for use in this script:
Form object
clsArray
clsSecurity
clsBDScheme
clsBDProfjob
183
ProfjobAnalyteAddNew.scr
When selecting an analyte to add to a scheme of a job, if the file ProfjobAnalyteAddNew.scr exists, the form
is run. This form can be used return an analyte code to be added to the job's scheme.
Subroutines run from this script:
Sub Form_Load()
Sub SQLWhere()
Sub SQLOrder() - Default order is SCH_CODE, SCHVERSION
Sub cmdQuery_Click()
Objects exposed from Scheme.exe for use in this script:
Form object
clsArray
clsSecurity
clsBDScheme
clsBDProfjob
BatchProcedureAddNew.scr
When selecting a procedure to batch on, if the file BatchProcedureAddNew.scr exists, the form is run. This
form can be used return a procedure code to extract samples to be lab batched.
Subroutines run from this script:
Sub Form_Load()
Sub SQLWhere()
Sub SQLOrder()
Sub cmdQuery_Click()
Objects exposed from Batch.exe for use in this script:
Form object
clsArray
clsSecurity
clsBDProcreg
BatchSchemeAddNew.scr
When selecting a scheme to batch on, if the file BatchSchemeAddNew.scr exists, the form is run. This form
can be used return a scheme code to extract samples to be lab batched.
Subroutines run from this script:
Sub Form_Load()
Sub SQLWhere()
Sub SQLOrder() - Default order SCH_CODE, SCHVERSION
Sub cmdQuery_Click()
184
CCLAS 1.4
QuoteProcedureAddNew.scr
When selecting a procedure to add to a quote, if the file QuoteProcedureAddNew.scr exists, the form is run.
This form can be used return a procedure code to be added to the quote.
Subroutines run from this script:
Sub Form_Load()
Sub SQLWhere()
Sub SQLOrder()
Sub cmdQuery_Click()
Objects exposed from ccQtWz01.dll for use in this script:
Form object
clsSecurity
clsBDProcreg
QuoteSchemeAddNew.scr
When selecting a scheme to add to a quote, if the file QuoteSchemeAddNew.scr exists, the form is run. This
form can be used return a scheme code to be added to the quote.
Subroutines run from this script:
Sub Form_Load()
Sub SQLWhere()
Sub SQLOrder()
Sub cmdQuery_Click()
Objects exposed from ccQtWz01.dll for use in this script:
Form object
clsSecurity
clsBDScheme
185
186
CCLAS 1.4
Script snippets
Adding single samples to a job
Example of adding a single sample to a job:
oProfile.clsBDProfJob.AddSampleToConcDB sJobNum, sSamID
187
Copying jobs
Example of creating the next automatic job as defined by the UNIQUENO AUTOJOB, where the client and
project for the job is the same as the template job, using a created clsProfile class call:
oProfile.clsBDProfjob.CopyProfJob "", "", "_TEMPLATE", "", "", "^AUTOJOB"
Note that the following are equivalent since either the client or project is blank:
oProfile.clsBDProfjob.CopyProfJob "", "", "_TEMPLATE", "ClientA", "", "^AUTOJOB"
oProfile.clsBDProfjob.CopyProfJob "", "", "_TEMPLATE", "", "Project1", "^AUTOJOB"
Example of creating the next automatic job as defined by the UNIQUENO AUTOJOB and the client and
project for this job will be ABC MINING, PROJECTX:
oProfile.clsBDProfjob.CopyProfJob "", "", "_TEMPLATE", "ABC MINING", "PROJECTX", "^AUTOJOB"
SamReg
Sample edit screen scripts
If a sample is opened on the sample registration screen, the script filename (default script is
SamRegEdit.scr) stored for the sample, in the Profjob_Cuid table ScreenFile field, is run. This allows for the
editing of sample details.
Subroutines run from this script:
Sub Form_Load()
Form_Unload()
Form_Save()
Form_Resize()
Objects exposed from Profile.exe for use in this script:
Form
clsArray
clsSecurity
clsBDScheme
clsBDProfjob
clsProfRep
Samana (Online)
After saving data for a sample scripts
After saving the analytical data for a sample by selecting the File Save Sample menu option, if the file
SamUDF.vbs exists, the AfterSave subroutine in it is run for the job, scheme, sample, either for interactive or
non-interactive mode.
Subroutines run from this script:
AfterSave(sProjob, sSchCode, sCuid, bInteractive)
188
CCLAS 1.4
MDE
After loading the sheet scripts
After a sheet of sample data is loaded, if the file defined by the MDE initialization setting AutoRunAfterLoad
exists, the Main subroutine in it is run.
189
190
CCLAS 1.4
191
QC validation scripts
After the Edit Check QC values menu option is selected, but before validation occurs, if the file defined by
the MDE initialization setting ValidateScript exists, the Main subroutine in it is run.
Subroutines run from this script:
Sub Main()
Objects exposed from MDE.exe for use in this script:
clsArray
clsSecurity
Sheet
F1Book
clsVariables
clsBDScheme
clsBDProfjob
clsCCComm
StatusBar
QC ignore scripts
After the Edit Ignore menu option is selected, but before ignoring occurs, if the file defined by the MDE
initialization setting IgnoreScript exists, the Main subroutine in it is run.
Subroutines run from this script:
Sub Main()
192
CCLAS 1.4
QC trend scripts
After the File Command menu option and QC command is selected, if the file QCTrend.vbs exists, the
Form_Activate subroutine in it is run.
Subroutines run from this script:
Sub Form_Activate()
Sub Form_Load()
Sub Form_Unload()
Sub Form_Save()
Sub Form_Resize()
Objects exposed from MDE.exe for use in this script:
Form
clsArray
Sheet
clsSecurity
F1Book
F1Book2
clsVariables
clsBDScheme
clsBDProfjob
clsCCComm
ctlChart
frmQC
ccComm01.dll
Instrument format file scripts
To communicate and decode data from an instrument, the Main subroutine is run from the instrument format
file (i.e., instrument.vbs).
Subroutines run from this script:
Sub Main()
193
194
CCLAS 1.4
195
IFF Scripting
The CCLAS EL data log module provides various powerful features for loading in data from different
instruments. It is the purpose of this document to explain in more detail the various features available.
In order to capture data from instruments via file transfer or RS232 port, it is necessary to use the Comm
class clsCCComm. This class is accessible from the MDE and Samana programs via a VBScript file, which
forms the basis of the IFF (Instrument Format File).
The sections below describe each property, method and events handled by the class.
Once a data record is captured, it is passed to a Subroutine (if present) called Got_Record( ). This
subroutine can further manipulate the input buffer as required. At the end of this subroutine, the input buffer
CommsBuffer is 'decoded' by the IFF Settings
Properties
Property
Mode
Data
Description
AdvanceLockedSamples
Read
Type
Boolean
Write
AdvanceSample
Read
Boolean
Write
next sample.
This could be the time to wait for the display on
the current sample before moving onto next
sample. Zero (0) is no movement.
Ie
clsCCComm..AdvanceSample = 3
AllowAlphanumeric
Read
Boolean
AutoAppendMode
Write
Read
Numeric
captured as results.
If set to True will register an extra sample if the
Write
'
append modes:
'
0 - Never
'
1 - Manual
AutoProductCheck
Read
Boolean
'
2 - Auto
If set to True will automatically check product
AutoUpdate
Write
Read
Boolean
rules.
If set to True will automatically update the QC
Write
196
statuses.
CCLAS 1.4
Property
Mode
Data
Description
BlkItems
Read
CommPort
Write
Read
Long
collection.
The COM port number. Values include 1, 2, 3, 4
CommPortSettings
Write
Read
String
etc
The various COM port settings such as baud rate,
Type
Provides access to the QC Blank codes
Write
CommsBuffer
Read
String
ConfirmResultOverwrite
Write
Read
Boolean
Cuid
Write
Read
String
overwrite results.
The sample CUID. Read-only.
Cycles
Only
Read
Long
CycleWidth
Only
Read
Long
Write
cycle.
Example:
clsCCComm.CycleWidth=20
DataItems
Read
DataMatchString
Write
Read
DateAnalysedItem
Write
Read
DecodedData
Write
Read
DecodedDataCachedRecords
Write
Read
Long
DupItems
Write
Read
String
EOFFileCommunication
Only
Read
Boolean
String
Only
Read-only property.
Example:
If clsCCComm.EOFFileCommunication Then
ErrorItems
Read
String
FileCommunication
Only
Read
String
Only
197
Property
Mode
Data
Description
FileDelay
Read
Type
Long
Handshaking
Write
Read
Long
communication.
A communications protocol.
Write
Usage: clsCCComm.Handshaking =
HandShakingConstant
HandShakingConstant can be any one of the
following values:
comNone
0. No handshaking
comXOnXOff
1. XOn/XOff handshaking
comRTS
2. Request-to-send/clear-to-send
handshaking.
comRTSXOnXOff
3. Request-to-send,
XOn/XOff handshaking.
Example:
clsCCComm.Handshaking =
clsCCComm.Handshaking = 2
clsCCComm.Handshaking = 0
clsCCComm.Handshaking = 3
clsCCComm.Handshaking = comXOnXOff
IFFScript
Read
String
IgnoreItems
Only
Read
Collection
InstrumentActive
Write
Read
Boolean
InstrumentMedia
Only
Read
InstrumentName
Write
Read
String
Job
Write
Read
String
Example: clsCCComm.InstrumentName=PE5100
Provides access to the job number. Read-only.
MultiplicationFactor
Only
Read
Double
selected.
Write
data.
Example:
clsCCComm.MultiplicationFactor=5.3235
NewFileCommunication
Read
String
Write
OnKeyItems
Read
PostSSDFile
Write
Read
Write
198
String
CCLAS 1.4
Property
Mode
Data
Description
PreserveValue
Read
Type
Boolean
PreSSDBuffer
Write
Read
String
PreSSDFile
Write
Read
String
ProfJob
Write
Read
PromptForFileCommunication
Write
Read
Boolean
ProtocolCode
Write
Read
String
Write
required.
.ProtocolCode = "P"
.ProtocolSend = chr(6)
String
.ProtocolReceive = chr(5)
Defines the protocol characters to be received.
ProtocolReceive
Read
ProtocolSend
Write
Read
String
QCFailureBeeps
Write
Read
Long
.ProtocolSend = chr(6)
Number of speaker beeps to sound when a
.ProtocolReceive = chr(5)
Write
QCFailureWAVFile
Read
String
Write
RecordHeaderLength
Read
Long
RecordLength
Write
Read
Long
RecordTrailerLength
Write
Read
Long
RepItems
Write
Read
ResultType
Write
Read
Write
String
199
Property
Mode
SampleFieldsItems
Read
Scheme
Write
Read
Security
Write
Read
Data
Description
Type
Object
Write
StdItems
Read
TerminatorCode
Write
Read
String
Write
UnkItems
Read
WarningItems
Write
Read
collection.
Provides access to the instrument warning codes
WeightToVolumeCorrect
Write
Read
Boolean
Write
collection.
Specifies whether weight to volume correction
should be performed.
Example:
clsCCComm.WeightToVolumeCorrect=True
Workstation
Read
Only
String
Methods
Method
CloseDataSource
Description
Closes the data capture source. If from a file, the file is closed. If the data
Form
GetFileCommunicationRecord
HideStatusWindow
IFFList
OpenDataSource
200
CCLAS 1.4
Method
PerformOnkey
Description
Send a string to the instrument based on the key pressed. Requires the
SetOnKeyItem properties set.
Usage: clsCCComm.PerformOnKey iKey
Argument: iKey The key that was pressed. eg. vbKeyF6 etc.
Example:
clsCCComm.PerformOnKey vbKeyF6
clsCCComm.PerformOnKey 13
PerformPreSSD
RewindFileCommunication
SetBlkItem
Specifies the location within the record for the QC Blank Code and the code
against which a comparison is made with the input from the instrument in
order to determine if the sample is a QC Blank Sample.
Usage: clsCCComm.SetBlkItem lIndex, lStart, lEnd, sStr
Arguments:
lIndex Data item number (index)
iStart
Start position
IEnd
End position
sStr
QC Blank string
Example:
clsCCComm.SetBlkItem 1,15,17,"BLK"
SetCuid
lEnd
End position
sDef
Example:
clsCCComm.SetCuid 1,20
SetCycles
Start position
iEnd
End position
Example:
ClsCCComm.SetCycles 4,21,25
201
Method
SetDataItem
Description
Specify the position or location of data.
Usage: clsCCComm.SetDataItem lIndex, lStart, lEnd
Arguments:
lIndex Data item number (index)
lStart
Start position
IEnd
End position
Example:
clsCCComm.SetDataItem 1,26,55
SetDateAnalysedItem
SetDupItem
.SetDateAnalysedItem
"DAY",6,7
.SetDateAnalysedItem
"MONTH",8,9
.SetDateAnalysedItem
"YEAR",10,11
.SetDateAnalysedItem
"HOUR",12,13
.SetDateAnalysedItem
"MINUTE",14,15
.SetDateAnalysedItem "SECOND",16,17
Specifies the location within the record for the QC Duplicate Code and the
code against which a comparison is made with the input from the instrument
in order to determine if the sample is a QC Duplicate Sample.
Usage: clsCCComm.SetDupItem lIndex, lStart, lEnd, sStr
Arguments:
iIndex Data item number (index)
iStart
Start position
iEnd
End position
sStr
QC Code string
Example:
clsCCComm.SetDupItem 1,15,16,"D"
SetErrorItem
Specify the location within the data transmission for the error codes supplied
by the instrument.
Usage: clsCCComm.SetErrorItem lIndex, lStart, lEnd, sErrStr
Arguments:
lIndex Data item number (index)
lStart
IEnd
End position.
202
CCLAS 1.4
Method
SetFileCommunication
Description
Specify the location of file for data transmission.
Usage: clsCCComm.SetFileCommunication sFile, [bPrompt]
Arguments:
sFile
bPrompt
Example:
sLecoFile="I:\cclasel\data\leco.txt"
clsCCComm.SetFileCommunication sLecoFile, False
SetIgnoreItem
Example:
sIgnoreStr="Sample"
clsCCComm.SetIgnoreItem 1,sIgnoreStr
SetJob
Start position
lEnd
End position
[sDefault]
Example:
clsCCComm.SetJob 1,20
SetNameItem
Start position
lEnd
End position
Example:
clsCCComm.SetNameItem 1,50,59,"FE",True
203
Method
SetOnkeyItem
Description
Specify strings that will be sent to the instrument based on a key that is
pressed.
Usage: clsCCComm.SetOnKeyItem lKey, sString
Arguments:
lKey
vbKeyD etc.
sString The string to send to the instrument.
Example:
clsCCComm.SetOnKeyItem vbKeyF6, "S"
clsCCComm.SetOnKeyItem vbKeyF7, "D"
SetRepItem
The start and end position in the record for the QC Replicate Code and the
code against which a comparison is made with the input from the instrument
in order to determine if the sample is a QC Replicate Sample.
Usage: clsCCComm.SetRepItem lIndex, lStart, lEnd, sStr
Arguments:
lIndex Data item number (index)
iStart
Start position
iEnd
End position
sStr
QC Replicate string
Example:
clsCCComm.SetRepItem 1,15,16,"R"
SetSampleFieldsItem
iEnd
sDefault
sStr
QC Replicate string
Example:
.SetSampleFieldsItem "SAMPLETYPE", 0, 0, "UNK", "STRING"
.SetSampleFieldsItem "SAMPLEIDENT", 41, 60, "", "STRING"
204
CCLAS 1.4
Method
SetScheme
Description
Specify the scheme code.
Usage: clsCCComm.setscheme lStart, lEnd, [sDefault]
Arguments:
lStart
Start position
lEnd
End position
[sDefault]
If the Start and End positions are zero, then the default can be specified. If
the input between the Start and End position is blank, then the Default will
be assumed.
Examples:
clsCCComm.SetScheme 12,20
clsCCComm.SetScheme 0,0,"XRF1"
SetStdItem
The start and end position in the record for the QC Standard Code and the
string against which a comparison is made with the input from the
instrument in order to determine if the sample is a QC Standard.
Usage: clsCCComm.SetStdItem lIndex, lStart, lEnd, sStr
Arguments:
lIndex Data item number (index)
lStart
Start position
IEnd
End position
sStr
QC Standard string
Example:
clsCCComm.SetStdItem 1,15,16,"S"
SetUnkItem
The start and end position in the record for the unknown sample and the
string against which a comparison is made with the input from the
instrument in order to determine if the sample is an unknown.
Usage: clsCCComm.SetUnkItem lIndex, lStart, lEnd, sStr
Arguments:
lIndex Data item number (index)
lStart
Start position
IEnd
End position
sStr
Unknown string
Example:
clsCCComm.SetUnkItem 1,15,16,"U"
205
Method
SetWarningItem
Description
The start and end position in the record for the warning field and the string
that is generated by the instrument in the event of a warning, e.g., out of
calibration range. When the information decoded from the position indicated
matches that defined, then a warning message is generated.
Usage: clsCCComm.SetWarningItem lIndex, lStart, lEnd, sStr
Arguments:
lIndex Data item number (index)
lStart
Start position
IEnd
End position
sStr
Example:
clsCCComm.SetWarningItem 1,15,18,"OVER"
ShowStatusWindow
Example 1:
Simple balance capture in MDE.
'
'
Globals
'
Option Explicit
'
'
IFF for MDE - simple balance interface
'
Sub Main ()
With clsCCComm
.AdvanceLockedSamples = True
.AdvanceSample = 0
.InstrumentName = "BAL1"
.TerminatorCode = chr(13) & chr(10)
.CommPort = 1
.CommPortSettings = "9600,O,7,1"
.SetDataItem 1,2,10
End With
End Sub
Example 2:
The following example demonstrates data capture using file communication.
Sub Main ()
clsCCComm.QCFailureWAVFile = "\\OSERVER\D\CCLASV5DEM\IFFSCRIPTS\OHNO.WAV"
With clsCCCOmm
.InstrumentName = "XRF2"
HandleError
.ResultType = "F"
HandleError
'
'
append modes:
'
0 - Never
'
1 - Manual
'
2 - Auto
'
.AutoAppendMode = 1
206
CCLAS 1.4
.AdvanceLockedSamples = True
.AutoProductCheck = True
.SetFileCommunication "\\OSERVER\D\CCLASV5DEM\IFFSCRIPTS\XRF2.DAT", False
HandleError
.TerminatorCode = Chr(13) & Chr(10)
HandleError
.SetIgnoreItem 1, "----", 0, 0
HandleError
.SetIgnoreItem 2, "Sample", 0, 0
HandleError
'
'
'
Items
.SetJob 1,10
.SetScheme 12,14
.SetCuid 16,25
.SetNameItem 1,0,0,"FEX", True
.SetNameItem 2,0,0,"SIX", True
.SetNameItem 3,0,0,"ALX", True
.SetNameItem 4,0,0,"SX", True
.SetNameItem 5,0,0,"CAX", True
.SetNameItem 6,0,0,"TIX", True
.SetNameItem 7,0,0,"MNX", True
.SetNameItem 8,0,0,"MGX", True
'
.SetDataItem
.SetDataItem
.SetDataItem
.SetDataItem
.SetDataItem
.SetDataItem
.SetDataItem
.SetDataItem
1,26,35
2,36,45
3,46,55
4,56,65
5,66,75
6,76,85
7,86,95
8,96,105
End With
End Sub
'
'
Sub HandleError ()
If err.number <> 0 Then
MsgBox Err.Description, vbOKOnly, "Handled Error"
End If
err.clear
End Sub
Example 3:
The following example will register a sample manually if it comes across a sample that does not exist in the
job.
Sub Main ()
clsCCComm.QCFailureWAVFile = "\\OSERVER\D\CCLASV5DEM\IFFSCRIPTS\OHNO.WAV"
With clsCCCOmm
.InstrumentName = "LOI2"
HandleError
.ResultType = "F"
HandleError
'
'
append modes:
'
0 - Never
'
1 - Manual
'
2 - Auto
'
.AutoAppendMode = 1
.AdvanceLockedSamples = True
.AutoProductCheck = True
.SetFileCommunication "\\OSERVER\D\CCLASV5DEM\IFFSCRIPTS\LOI.DAT", False
HandleError
.TerminatorCode = Chr(13) & Chr(10)
HandleError
'
'
Items
'
.SetJob 1,10
.SetScheme 12,14
207
1,0,0,"WT1",
2,0,0,"WT2",
3,0,0,"WT3",
4,0,0,"WT4",
True
True
True
True
'
.SetDataItem 1,26,35
.SetDataItem 2,36,45
.SetDataItem 3,46,55
.SetDataItem 4,56,65
'.SetDataItem 5,66,75
'.SetDataItem 6,76,85
'.SetDataItem 7,86,95
'.SetDataItem 8,96,105
End With
clsCCCOmm.ShowStatusWindow 100,100,1000,4000
End Sub
'
'
Sub HandleError ()
If err.number <> 0 Then
MsgBox Err.Description, vbOKOnly, "Handled Error"
End If
err.clear
End Sub
208
CCLAS 1.4
Example 4:
The following example uses cycles to decode the elements and data via file. This would typically be a noninteractive session of SAMANA.
Sub Main ()
'
clsCCComm.QCFailureWAVFile = "\\OSERVER\D\CCLASV5DEM\IFFSCRIPTS\OHNO.WAV"
clsCCComm.FileDelay = 1
With clsCCCOmm
.InstrumentName = "SAM"
HandleError
.ResultType = "F"
HandleError
'
'
append modes:
'
0 - Never
'
1 - Manual
'
2 - Auto
'
.AutoAppendMode = 1
.AdvanceLockedSamples = True
.AutoProductCheck = True
.AutoUpdate = True
.NewFileCommunication = "\\OSERVER\D\CCLASV5DEM\BIN\COLLECT.DAT"
'
.SetFileCommunication "\\OSERVER\D\CCLASV5DEM\BIN\COLLECT.DAT", False
HandleError
.TerminatorCode = Chr(13) & Chr(10)
HandleError
.SetIgnoreItem 1, "----", 0, 0
HandleError
.SetIgnoreItem 2, "Sample", 0, 0
HandleError
'
'
Items
'
.SetJob 1,20
.SetScheme 41,50
.SetCuid 21,40
.SetCycles 20,51,60
.CycleWidth = 20
.SetCycles 17,21,23
'
.SetNameItem 1,61,70,"", True
'
.SetDataItem 1,71,80
End With
End Sub
'
'
Sub HandleError ()
If err.number <> 0 Then
MsgBox Err.Description, vbOKOnly, "Handled Error"
End If
err.clear
End Sub
Example 5:
The following example uses a generic IFF file that starts a form to request some details.
Generic.VBS
(IFF)
'
'
Globals
'
Option Explicit
Sub Main ()
clsCCComm.InstrumentName = ""
'
if clsCCComm.Workstation <> "GC733" Then
clsCCComm.Form "I:\CCLASV5ORA\IFFSCRIPTS\GENERIC.SCR"
'
else
'
clsCCComm.InstrumentName = clsCCComm.Workstation
209
'
end if
if len(rtrim(ltrim(clsCCComm.InstrumentName))) = 0 then
msgbox "Must Select Instrument"
else
SetInst clsCCComm.InstrumentName
end if
End Sub
'
'
Sub SetInst(sInstName)
On Error Resume Next
clsCCComm.ResultType = "W"
With clsCCCOmm
.AdvanceLockedSamples = True
.AdvanceSample = 0
.TerminatorCode = chr(13) & chr(10)
.CommPort = 1
HandleError ()
.CommPortSettings = "9600,N,8,1"
HandleError ()
.SetDataItem 1,1,10
HandleError ()
End With
End Sub
Sub HandleError ()
If err.number <> 0 Then
MsgBox Err.Description, vbokonly, "Error BAL1.VBS"
End If
err.clear
End Sub
and Generic.SCR (Form)
'FORM,0,0,5000,4000,1
'LISTBOX,lstInstCode,,,,240,150,3120,3345,,,,,,
'COMMANDBUTTON,cmdOK,,OK,,240,3390,1410,360,,,,,,
'COMMANDBUTTON,cmdCancel,,Cancel,,735,3390,1410,360,,,,,,
Sub Form_Load ()
Form.Top = 1000
Form.Left = 1000
lstInstCode.AddItem "AAS1"
lstInstCode.AddItem "AAS2"
lstInstCode.AddItem "AAS3"
lstInstCode.AddItem "AAS4"
lstInstCode.AddItem "AAS5"
End Sub
Sub cmdCancel_Click()
on error resume next
clsCCComm.InstrumentName = ""
Form.Hide
End Sub
Sub cmdOK_click
on error resume next
clsCCComm.InstrumentName = lstInstCode.Text
Form.Hide
End Sub
Sub lstInstCode_DblClick()
cmdOK_Click
End Sub
210
CCLAS 1.4
Answer:
As the message says, the database does not have a valid owner. This happens if you install a database and
does not link an owner, or when you restore a database from another server where the owner on the original
server, does not correspond with the owner on the restoring server.
To fix this, right-click on the database you want to change the owner for, and select Properties:
211
Sometimes the Compatibility level is still set to the older version of SQL the original database comes from
so set it to SQL Server 2005.
Now click on the Files option in the left pane:
212
CCLAS 1.4
Here you can set to Owner of the database to the new profile that has to be the owner. How do I do that?
Question:
When I try to add CCLASMGR as a user to my database, I get the following message:
Answer:
CCLASMGR already exists in the database as a user. But you may find that you still cannot log into CCLAS
using CCLASMGR! The problem is that, even though CCLASMGR exists, the password assigned to
CCLASMGR on the previous server, is not the same as the password assigned to CCLASMGR on the
current server. So what does one do?
213
In your database, you first have to remove CCLASMGR from your security. Let us first create another error:
Expand your Database, expand Security and expand Users. Select the CCLASMGR user and press Delete:
When you click on OK on the following screen, either CCLASMGR will delete, or the following screen
appears:
214
CCLAS 1.4
which indicates that you could not delete the CCLASMGR user. If this happens, you first have to check if
CCLASMGR is also one of the Schemas in the database:
Expand you database, expand Security and expand Schemas:
215
As you may see in the screen capture, CCLASMGR is a Schema. So let us delete that first select
CCLASMGR, and press the Delete key.
The following screen will appear:
Answer:
One of a few things may be wrong:
216
CCLAS 1.4
217