5Quick Reference for Siebel VB Methods
Quick Reference for Siebel VB Methods
This quick reference section lists Siebel VB methods. It includes the following topics:
Disk and Directory Control Quick Reference
The following table lists methods that you can use to control disks and directories.
| Statement | Purpose | Reference |
|---|---|---|
ChDir |
Modifies the default directory for a drive. |
|
ChDrive |
Modifies the default drive. |
|
CurDir |
Returns the current directory for a drive. |
|
MkDir |
Creates a directory. |
|
RmDir |
Removes a directory. |
File Control Quick Reference
The following table lists methods that you can use to control files.
| Statement | Purpose | Reference |
|---|---|---|
Close |
Closes a file. |
|
Dir |
Returns a file name that matches a pattern. |
|
FileAttr |
Returns the file mode or the operating system handle for an open file. |
|
FileCopy |
Copies a file. |
|
FileDateTime |
Returns the last modification date and time of a file. |
|
FileLen |
Returns the length of a file. |
|
FreeFile |
Returns the next unused file number. |
|
GetAttr |
Returns attributes of a file, directory, or volume label. |
|
Kill |
Deletes a file. |
|
Lock |
Controls access to an open file. |
|
Lof |
Returns the length of a file in bytes. |
|
Name |
Renames a file or copies a file from one directory to another directory. |
|
Open |
Opens a file. |
|
Reset |
Closes open files and writes to disk any data that currently resides in buffers. |
|
SetAttr |
Sets attribute information for a file. |
|
Unlock |
Controls access to some or all of an open file by other processes. |
File Input and Output Quick Reference
The following table lists methods that you can use to manipulate data in a file.
| Statement | Purpose | Reference |
|---|---|---|
Eof |
Determines if the end of an open file has been reached. |
|
Get |
Reads the content of a file, and then places this content in a variable. |
|
Input |
Returns a string of characters from a file. |
|
Input filenumber, variable |
Reads data from a file, and then saves this data to different variables. |
|
Line Input |
Reads a line from a sequential file, and then saves it in a string variable. |
|
Loc |
Returns the current offset of a file. |
|
Prints data to a file or to the screen. |
||
Put |
Writes a variable to a file. |
|
Seek filenumber |
Returns the current position for a file. |
|
Seek filenumber, position |
Sets the position of the next read or write operation in an open file. |
|
Spc |
Prints a number of spaces. |
|
Tab |
Sets the current print position. |
|
Width |
Sets the output line width for an open file. |
|
Write |
Writes data to a sequential file. |
Code Setup and Control Quick Reference
The following table lists methods that you can use to perform setup tasks and to control the flow of logic in Siebel VB code.
| Statement | Purpose | Reference |
|---|---|---|
Shell |
Starts a Microsoft Windows application. |
|
Call |
Transfers control to a subroutine. |
|
Sub name |
Creates a subroutine. |
|
Function |
Creates a function. |
|
Type userType |
Declares a custom data type. |
|
Declare Sub Declare Function |
Declares a procedure or a function. |
|
Const constantName |
Declares a symbolic constant. |
|
Environ |
Returns a string from the operating system environment |
|
Nothing |
Sets an object variable to not reference an object. |
|
AppActivate |
Sends keystrokes to a Microsoft Windows application. |
|
Clipboard |
Accesses the Microsoft Windows clipboard. |
Code Control Statements Quick Reference
The following table lists statements you can use to control the flow of logic in Siebel VB code.
| Statement | Purpose | Reference |
|---|---|---|
_ |
Treats the next line as a continuation of the current line. |
Not applicable. |
Command |
Returns the command line specified when the MAIN sub runs. |
Not applicable. |
Do Loop |
Controls repetitive actions. |
|
Exit |
Causes the current procedure or loop structure to return. |
|
For Next |
Loops a fixed number of times. |
|
Go To |
Sends control to a statement. |
|
Go To Label |
Branches to one of multiple labels depending on value. |
|
If...Then... Else |
Branches on a conditional value. |
|
Me |
Gets the current object. |
|
Rem or ’ |
Treats the remainder of the line as a comment |
|
Select Case |
Runs one of a series of statement blocks. |
|
Stop |
Stops code from running. |
|
While Wend |
Controls repetitive actions. |
Variable Manipulation Quick Reference
The following table lists methods to manipulate variables.
| Statement | Purpose | Reference |
|---|---|---|
Deftype |
Sets the default data type for one or more variables. |
|
Dim |
Declares a variable. |
|
Global |
Declares a global variable. |
|
Let |
Assigns a value to a variable. |
|
Null |
Sets a variant variable to a value of Null. |
|
Option Explicit |
Forces you to explicitly declare every variable in a module. |
|
Static |
Declares a variable and allocates storage space for this variable. |
|
VarType |
Returns the type of data stored in a variant. |
|
With |
Runs a series of statements on a variable. |
Strings Quick Reference
The following table lists methods to manipulate strings.
| Statement | Purpose | Reference |
|---|---|---|
Chr |
Converts a character code to a string. |
|
Format |
Returns an expression in a format that you specify. |
|
InStr |
Returns the position of one string in another string. |
|
LCase |
Converts a string to lower case. |
|
Left |
Returns a string copied from the beginning of another string. |
|
Len |
Returns the length of a string or size of a variable. |
|
Like |
Compares the contents of two strings. |
|
Lset |
Copies one string to another string or assigns a custom variable to another variable. |
|
LTrim |
Removes leading spaces from a string. |
|
Mid |
Returns a portion of a string. |
|
Mid = string |
Replaces part or all of one string with another string. |
|
Option Compare |
Specifies the default method for string comparisons to case-sensitive or not case-sensitive. |
|
Right |
Returns the right portion of a string. |
|
Rset |
Right-justifies one string in another string. |
|
RTrim |
Removes trailing spaces from a string. |
|
Space |
Returns a string of spaces. |
|
Str |
Returns the string representation of a number. |
|
StrComp |
Compares two strings. |
|
String |
Returns a string that consists of a repeated character. |
|
Trim |
Removes leading and trailing spaces from a string. |
|
UCase |
Converts a string to upper case. |
|
Val |
Returns the numeric value of the first number that it finds in a string. |
Arrays Quick Reference
The following table lists methods for manipulating arrays.
| Statement | Purpose | Reference |
|---|---|---|
Erase |
Erases the contents of an array. |
|
LBound |
Gets the lower boundary of an array. |
|
Option Base |
Specifies the default lower boundary to use for an array. |
|
ReDim |
Declares an array and reallocates memory. |
|
UBound |
Gets the upper boundary of an array. |
Math Operations Quick Reference
The following table lists methods to perform mathematical operations.
| Statement | Purpose | Reference |
|---|---|---|
Abs |
Returns the absolute value of a number. |
|
Asc |
Returns an integer that corresponds to an ANSI character code. |
|
Atn |
Returns the arctangent of a number. |
|
Cos |
Returns the cosine of an angle. |
|
Exp |
Returns the value of e raised to a power. |
|
Fix |
Removes the fractional part of a number. |
|
Hex |
Returns the hexadecimal representation of a number. |
|
Int |
Returns the integer part of a number. |
|
Log |
Returns the natural logarithm of a value. |
|
Oct |
Returns the octal representation of a number. |
|
Randomize |
Creates a starting value for the random number generator. |
|
Rnd |
Returns a random number. |
|
Sgn |
Returns a value that identifies the sign of a number. |
|
Sin |
Returns the sine of an angle. |
|
Sqr |
Returns the square root of a number. |
|
Tan |
Returns the tangent of an angle. |
Date and Time Quick Reference
The following table lists methods for date and time information.
| Statement | Purpose | Reference |
|---|---|---|
Date |
Converts an expression to the data type variant of type date. |
|
Date = expression |
Sets the computer date. |
|
DateSerial |
Converts a number to a date. |
|
DateValue |
Converts a string to a date. |
|
Day |
Returns the day component of a date and time value. |
|
Hour |
Returns the hour of day component of a date and time value. |
|
Minute |
Returns the minute component of a date and time value. |
|
Month |
Returns the month component of a date and time value. |
|
Now |
Returns the current date and time. |
|
Second |
Returns the second component of a date and time value. |
|
Time |
Returns the current time. |
|
Time = expression |
Sets the current time. |
|
Timer |
Returns the number of seconds since midnight. |
|
TimeSerial |
Returns the time for a specific hour, minute, and second. |
|
TimeValue |
Converts a string to time. |
|
Weekday |
Returns the day of the week for the specified date and time value. |
|
Year |
Returns the year component of a date and time value. |
ODBC Quick Reference
The following table lists methods that you can use with ODBC.
| Statement | Purpose | Reference |
|---|---|---|
SQLClose |
Disconnects from an ODBC data source connection. |
|
SQLError |
Returns a detailed error message for an error that occurs during an ODBC method call. |
|
SQLExecQuery |
Runs an SQL statement. |
|
SQLGetSchema |
Gets information about data sources, databases, users, owners, and so on. |
|
SQLOpen |
Establishes a connection to an ODBC data source. |
|
SQLRequest |
Makes a connection to a data source, runs an SQL statement, returns the results. |
|
SQLRetrieve |
Returns the results of a select statement that SQLExecQuery runs. |
|
SQLRetrieveToFile |
Gets the results of an SQL query and stores them in a file. |
Object Querying Quick Reference
The following table lists methods that you can use to query an object.
| Statement | Purpose | Reference |
|---|---|---|
If Typeof |
Determines if an object is of a given class. |
|
IsDate |
Determines if an expression evaluates to a date that Oracle’s Siebel VB allows. |
|
IsEmpty |
Determines if a variant has been set. |
|
IsMissing |
Determines if an optional argument for a procedure is missing. |
|
IsNull |
Determines if a variant contains a NULL value. |
|
IsNumeric |
Determines if a value is a valid number. |
Financials Quick Reference
The following table lists methods that you can use to calculate financial information.
| Statement | Purpose | Reference |
|---|---|---|
FV |
Returns future value of a cash flow stream. |
|
IPmt |
Returns interest payment for a given period. |
|
IRR |
Returns internal rate of return for a cash flow stream. |
|
NPV |
Returns net present value of a cash flow stream. |
|
Pmt |
Returns a constant payment for each period for an annuity. |
|
PPmt |
Returns principal payment for a given period. |
|
PV |
Returns present value of a future stream of cash flows. |
|
Rate |
Returns interest rate for each period. |
Conversions Quick Reference
The following table lists methods that you can use to convert a value.
| Statement | Purpose | Reference |
|---|---|---|
CCur |
Converts a value to currency. |
|
CDbl |
Converts a value to a double-precision floating point number. |
|
CInt |
Converts a value to an integer. |
|
CLng |
Converts a value to a long number. |
|
CSng |
Converts a value to single-precision, floating point number. |
|
CStr |
Converts a value to a string. |
|
CVar |
Converts a number or string to a variant. |
|
CVDate |
Converts a value to a date. |
COM Object Quick Reference
The following table lists methods for COM objects.
| Statement | Purpose | Reference |
|---|---|---|
CreateObject |
Creates a new COM object. |
|
Dim As Object |
A class that provides access to a COM object. |
|
GetObject |
Gets a COM object from a file or gets the active COM object for a COM class. |
|
New |
Allocates and initializes a new COM object. |
|
Set |
Assigns a COM object to a variable. |
Error Handling Quick Reference
The following table lists methods for error handling.
| Statement | Purpose | Reference |
|---|---|---|
Erl |
Returns a number that identifies the code line where an error occurred. |
|
Err |
Returns the error code of the last Visual Basic error handled. |
|
Err = errornumber |
Sets a run-time error code. |
|
Error |
Returns the error message that corresponds to an error code. |
|
Error errornumber |
Simulates the occurrence of an error. |
|
On Error |
Identifies the location of code that handles an error. |
|
Resume |
Stops the code that handles an error. |