5Quick Reference for Siebel VB Methods

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.

Change Directory Method

ChDrive

Modifies the default drive.

Change Drive Method

CurDir

Returns the current directory for a drive.

Get Current Directory Method

MkDir

Creates a directory.

Create Directory Method

RmDir

Removes a directory.

Remove Directory Method

File Control Quick Reference

The following table lists methods that you can use to control files.

Statement Purpose Reference

Close

Closes a file.

Close File Method

Dir

Returns a file name that matches a pattern.

Get File Names Method

FileAttr

Returns the file mode or the operating system handle for an open file.

Get File Mode Method

FileCopy

Copies a file.

Copy File Method

FileDateTime

Returns the last modification date and time of a file.

Get File Date Method

FileLen

Returns the length of a file.

Get File Length 2 Method

FreeFile

Returns the next unused file number.

Get Free File Number Method

GetAttr

Returns attributes of a file, directory, or volume label.

Get File Attributes Method

Kill

Deletes a file.

Delete File Method

Lock

Controls access to an open file.

Lock File Method

Lof

Returns the length of a file in bytes.

Get File Length Method

Name

Renames a file or copies a file from one directory to another directory.

Rename File Method

Open

Opens a file.

Open File Method

Reset

Closes open files and writes to disk any data that currently resides in buffers.

Close All Files Method

SetAttr

Sets attribute information for a file.

Set File Attributes Method

Unlock

Controls access to some or all of an open file by other processes.

Unlock File Method

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.

End of File Method

Get

Reads the content of a file, and then places this content in a variable.

Force Explicit Declaration Statement

Input

Returns a string of characters from a file.

Get Characters From File Method

Input filenumber, variable

Reads data from a file, and then saves this data to different variables.

Parse File Contents Method

Line Input

Reads a line from a sequential file, and then saves it in a string variable.

Get Line From File Method

Loc

Returns the current offset of a file.

Get File Offset Method

Print

Prints data to a file or to the screen.

Print Data to File Method

Put

Writes a variable to a file.

Write Variable to File Method

Seek filenumber

Returns the current position for a file.

Get File Position Method

Seek filenumber, position

Sets the position of the next read or write operation in an open file.

Set File Position Method

Spc

Prints a number of spaces.

Print Spaces Method

Tab

Sets the current print position.

Set Print Position Method

Width

Sets the output line width for an open file.

Set File Width Method

Write

Writes data to a sequential file.

Write Data to File Method

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 Application Method

Call

Transfers control to a subroutine.

Call Subroutine Method

Sub name

Creates a subroutine.

Create Subroutine Method

Function

Creates a function.

Create Function Method

Type userType

Declares a custom data type.

Declare Custom Data Type Method

Declare Sub Declare Function

Declares a procedure or a function.

Declare Procedure Method

Const constantName

Declares a symbolic constant.

Declare Symbolic Constant Method

Environ

Returns a string from the operating system environment

Get Environment Setting Method

Nothing

Sets an object variable to not reference an object.

Remove Object Method

AppActivate

Sends keystrokes to a Microsoft Windows application.

Send Keystrokes Method

Clipboard

Accesses the Microsoft Windows clipboard.

Use Clipboard Methods

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.

Do Loop Statement

Exit

Causes the current procedure or loop structure to return.

Exit Statement

For Next

Loops a fixed number of times.

For Next Statement

Go To

Sends control to a statement.

Go To Statement

Go To Label

Branches to one of multiple labels depending on value.

Go To Label Statement

If...Then... Else

Branches on a conditional value.

If Then Else Statement

Me

Gets the current object.

Me Statement

Rem or ’

Treats the remainder of the line as a comment

Rem Statement

Select Case

Runs one of a series of statement blocks.

Select Case Statement

Stop

Stops code from running.

Stop Statement

While Wend

Controls repetitive actions.

While Wend Statement

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.

Set Variable Data Type Statement

Dim

Declares a variable.

Declare Variable Statement

Global

Declares a global variable.

Declare Global Variable Statement

Let

Assigns a value to a variable.

Assign Expression to Variable Statement

Null

Sets a variant variable to a value of Null.

Set Variant Variable to Null Method

Option Explicit

Forces you to explicitly declare every variable in a module.

Force Explicit Declaration Statement

Static

Declares a variable and allocates storage space for this variable.

Declare Static Variable Statement

VarType

Returns the type of data stored in a variant.

Get Variant Type Method

With

Runs a series of statements on a variable.

Modify Variable Statement

Strings Quick Reference

The following table lists methods to manipulate strings.

Statement Purpose Reference

Chr

Converts a character code to a string.

Get ANSI String Method

Format

Returns an expression in a format that you specify.

Set String Format Method

InStr

Returns the position of one string in another string.

Get Substring Position Method

LCase

Converts a string to lower case.

Convert String to Lowercase Method

Left

Returns a string copied from the beginning of another string.

Get Left String Method

Len

Returns the length of a string or size of a variable.

Get String Length Method

Like

Compares the contents of two strings.

Compare Strings Operator

Lset

Copies one string to another string or assigns a custom variable to another variable.

Copy String Method

LTrim

Removes leading spaces from a string.

Remove Spaces From String Method

Mid

Returns a portion of a string.

Get Substring Method

Mid = string

Replaces part or all of one string with another string.

Replace String Method

Option Compare

Specifies the default method for string comparisons to case-sensitive or not case-sensitive.

Set String Comparison Method

Right

Returns the right portion of a string.

Get Right String Method

Rset

Right-justifies one string in another string.

Right-Justify String Method

RTrim

Removes trailing spaces from a string.

Trim Trailing Spaces From String Method

Space

Returns a string of spaces.

Get a String of Spaces Method

Str

Returns the string representation of a number.

Convert Number to String Method

StrComp

Compares two strings.

Compare Strings Method

String

Returns a string that consists of a repeated character.

Get Repeated Character String Method

Trim

Removes leading and trailing spaces from a string.

Trim Spaces From String Method

UCase

Converts a string to upper case.

Convert String to Uppercase Method

Val

Returns the numeric value of the first number that it finds in a string.

Get First Number From String Method

Arrays Quick Reference

The following table lists methods for manipulating arrays.

Statement Purpose Reference

Erase

Erases the contents of an array.

Erase Array Method

LBound

Gets the lower boundary of an array.

Get Array Lower Boundary Method

Option Base

Specifies the default lower boundary to use for an array.

Set Array Lower Boundary Method

ReDim

Declares an array and reallocates memory.

Declare Array Method

UBound

Gets the upper boundary of an array.

Get Array Upper Boundary Method

Math Operations Quick Reference

The following table lists methods to perform mathematical operations.

Statement Purpose Reference

Abs

Returns the absolute value of a number.

Get Absolute Value Method

Asc

Returns an integer that corresponds to an ANSI character code.

Get ANSI Integer Method

Atn

Returns the arctangent of a number.

Get Arctangent Method

Cos

Returns the cosine of an angle.

Get Cosine Method

Exp

Returns the value of e raised to a power.

Convert Number to Date Method

Fix

Removes the fractional part of a number.

Get Rounded Integer Method

Hex

Returns the hexadecimal representation of a number.

Get Hexadecimal Method

Int

Returns the integer part of a number.

Get Integer Method

Log

Returns the natural logarithm of a value.

Get Logarithm Method

Oct

Returns the octal representation of a number.

Get Octal Method

Randomize

Creates a starting value for the random number generator.

Randomize Method

Rnd

Returns a random number.

Get Random Number Method

Sgn

Returns a value that identifies the sign of a number.

Get Number Sign Method

Sin

Returns the sine of an angle.

Get Sine Method

Sqr

Returns the square root of a number.

Get Square Root Method

Tan

Returns the tangent of an angle.

Get Tangent Method

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.

Convert Number to Date Method

Date = expression

Sets the computer date.

Set Date Method

DateSerial

Converts a number to a date.

Convert Serial Number to Date Method

DateValue

Converts a string to a date.

Convert String to Date Method

Day

Returns the day component of a date and time value.

Extract Day From Date-Time Value Method

Hour

Returns the hour of day component of a date and time value.

Extract Hour From Date-Time Value Method

Minute

Returns the minute component of a date and time value.

Extract Minute From Date-Time Value Method

Month

Returns the month component of a date and time value.

Extract Month From Date-Time Value Method

Now

Returns the current date and time.

Get Current Date and Time Method

Second

Returns the second component of a date and time value.

Extract Second From Date-Time Value Method

Time

Returns the current time.

Get Current Time Method

Time = expression

Sets the current time.

Set Time Method

Timer

Returns the number of seconds since midnight.

Get Current Seconds Method

TimeSerial

Returns the time for a specific hour, minute, and second.

Get Serial Time Method

TimeValue

Converts a string to time.

Convert String to Time Method

Weekday

Returns the day of the week for the specified date and time value.

Extract Weekday From Date-Time Value Method

Year

Returns the year component of a date and time value.

Extract Year From Date-Time Value Method

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.

ODBC Close Connection Method

SQLError

Returns a detailed error message for an error that occurs during an ODBC method call.

ODBC Get Errors Method

SQLExecQuery

Runs an SQL statement.

ODBC Run Query Method

SQLGetSchema

Gets information about data sources, databases, users, owners, and so on.

ODBC Get Schema Method

SQLOpen

Establishes a connection to an ODBC data source.

ODBC Open Connection Method

SQLRequest

Makes a connection to a data source, runs an SQL statement, returns the results.

ODBC Run Query and Get Results Method

SQLRetrieve

Returns the results of a select statement that SQLExecQuery runs.

ODBC Get Query Results Method

SQLRetrieveToFile

Gets the results of an SQL query and stores them in a file.

ODBC Save Results to File Method

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.

Is Object Of Class Method

IsDate

Determines if an expression evaluates to a date that Oracle’s Siebel VB allows.

Is Expression a Date Method

IsEmpty

Determines if a variant has been set.

Is Variable Set Method

IsMissing

Determines if an optional argument for a procedure is missing.

Is Optional Argument Missing Method

IsNull

Determines if a variant contains a NULL value.

Is Variable Null Method

IsNumeric

Determines if a value is a valid number.

Is Variable Numeric Method

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.

Calculate Future Value Method

IPmt

Returns interest payment for a given period.

Calculate Interest Method

IRR

Returns internal rate of return for a cash flow stream.

Calculate Internal Rate of Return Method

NPV

Returns net present value of a cash flow stream.

Calculate Net Present Value Method

Pmt

Returns a constant payment for each period for an annuity.

Calculate Payment Method

PPmt

Returns principal payment for a given period.

Calculate Principal Method

PV

Returns present value of a future stream of cash flows.

Calculate Present Value Method

Rate

Returns interest rate for each period.

Calculate Interest Rate Method

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.

Convert Expression to Currency Method

CDbl

Converts a value to a double-precision floating point number.

Convert Expression to Double-Precision Method

CInt

Converts a value to an integer.

Convert Expression to Integer Method

CLng

Converts a value to a long number.

Convert Expression to Long Method

CSng

Converts a value to single-precision, floating point number.

Convert Expression to Single-Precision Method

CStr

Converts a value to a string.

Convert Expression to String Method

CVar

Converts a number or string to a variant.

Convert Expression to Variant Method

CVDate

Converts a value to a date.

Convert Number to Date Method

COM Object Quick Reference

The following table lists methods for COM objects.

Statement Purpose Reference

CreateObject

Creates a new COM object.

Create COM Object Method

Dim As Object

A class that provides access to a COM object.

COM Object Class

GetObject

Gets a COM object from a file or gets the active COM object for a COM class.

Get COM Object Method

New

Allocates and initializes a new COM object.

Initialize COM Object Method

Set

Assigns a COM object to a variable.

Assign COM Object Statement

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.

Get Error Code Line Method

Err

Returns the error code of the last Visual Basic error handled.

Get Error Code Method

Err = errornumber

Sets a run-time error code.

Set Error Code Method

Error

Returns the error message that corresponds to an error code.

Get Error Message Method

Error errornumber

Simulates the occurrence of an error.

Simulate Error Method

On Error

Identifies the location of code that handles an error.

On Error Method

Resume

Stops the code that handles an error.

Resume Statement