Le profil contient un script global, que vous pouvez utiliser pour stocker des fonctions et des variables à réutiliser dans vos scripts définis pour des extensions.
Par exemple, on peut imaginer rédiger une fonction pour obtenir le type de données d'un élément et le réutiliser dans les exemples de script de vérification personnalisée et de correction automatique (voir Vérifications personnalisées (Profile).
Function DataTypeBase(datatype)
Dim position
position = InStr(datatype, "(")
If position <> 0 Then
DataTypeBase = Ucase(Left(datatype, position -1))
Else
DataTypeBase = Ucase(datatype)
End If
End Function
Function %Check%(obj)
Dim c 'temporary index column
Dim col 'temporary column
Dim position
%Check%= True
If obj.type = "LF" or obj.type = "HG" or obj.type = "CMP" or obj.type ="HNG" then
For Each c In obj.IndexColumns
Set col = c.column
If (DataTypeBase(col.datatype) = "VARCHAR") And (col.length > 255) Then
Output "Table " & col.parent.name & " Column " & col.name & " : Data type is not compatible with Index " & obj.name & " type " & obj.type
%Check% = False
End If
Next
End If
End Function