UTILITY FUNCTIONS

QualiWare supports all the functions and classes of Visual Basic e C# available on the .NET 4.7.2 platform.

All these APIs are available in every script input inside QualiWare. These functions are a fundamental part in programming Form Designer events and Server Daemon tasks.

NOTE: the functions explained here are written using the VB.NET syntax.

In order to make the programming work more confortable, QualiWare has a list of built-in functions.

  • at(ByVal s1 As String, ByVal s2 As String, Optional ByVal n As Integer = 1) As Integer – returns the position of the first character of the n-th occurrence of s1 in s2. NOTE: the index system is 1-based.
  • Array2String(ByVal a As DBArray, Optional ByVal separator As String = ",") As String – returns a string made by concatenating the elements of the DBArray object specified as first argument, and by using the separator string specified as second argument.
  • CheckIfItemInList(ByVal list As String, ByVal item As String, Optional ByVal separator As String = Chr(13)) As Boolean – checks if the item string appears at least one time in the list string, using the separator string to distinguish the different list elements.
  • ctod(ByVal dateValue As String As String) As Date – transform the specified string into a date object, using the format of the current tongue.
  • dtoc(ByVal dateValue As Date, Optional ByVal fmt As String = Nothing) As String – transform the specified date into a string object, using the format of the current tongue or the one specified as second argument.
  • Empty(ByVal expression As Object) As Boolean – returns True if the specifies expression is “empty”. The “empty” value can be of different types:
    • String: "" or Nothing
    • Number: 0
    • Date: empty date
    • Boolean: False
    • Object: Nothing
  • File(ByVal path As String) As Boolean – checks if the file corresponding to the specified path exists.
  • Lower(ByVal str As String) As String – transform the string into lowercase.
  • max(ByVal a As Object, ByVal b As Object) As Object – returns, between two values, the maximum one.
  • min(ByVal a As Object, ByVal b As Object) As Object – returns, between two values, the minimum one.
  • rat(ByVal s1 As String, ByVal s2 As String, Optional ByVal n As Integer = 1) As Integer – returns the position of the first character of the n-th occurrence of s1 in s2, starting from the last character of s2. NOTE: the index system is 1-based.
  • replicate(ByVal str As String, ByVal n As Integer) As String – returns a string made by repeating the str variable n times.
  • Str(ByVal num As Object, Optional ByVal nChars As Integer = 15, Optional ByVal ndec As Integer = 0) As String – returns a string obtained by transforming num into a string of nChars characters with a number of decimals equal to ndec.
  • String2Array(ByVal s As String, Optional ByVal separator As String = ",", Optional ByVal noRemoveEmpty As Boolean = True) As DBArray – returns a DBArray object obtained by dividing the s string on the basis of the specified separator string. If the third parameter is True, it keeps any empty elements.
  • Substring(ByVal s As String, ByVal start As Integer, Optional ByVal nChars As Integer = Integer.MaxValue) As String – returns the substring of s obtained by starting from the character in the start position and including a number of characters equal to nChars. NOTE: the index system is 1-based.
  • Upper(ByVal str As String) As String – transform the string into lowercase.