Siebel VB Language Reference
Total Page:16
File Type:pdf, Size:1020Kb
Siebel VB Language Reference Version 7.7 March 2004 Siebel Systems, Inc., 2207 Bridgepointe Parkway, San Mateo, CA 94404 Copyright © 2004 Siebel Systems, Inc. All rights reserved. Printed in the United States of America No part of this publication may be stored in a retrieval system, transmitted, or reproduced in any way, including but not limited to photocopy, photographic, magnetic, or other record, without the prior agreement and written permission of Siebel Systems, Inc. Siebel, the Siebel logo, TrickleSync, Universal Agent, and other Siebel names referenced herein are trademarks of Siebel Systems, Inc., and may be registered in certain jurisdictions. Other product names, designations, logos, and symbols may be trademarks or registered trademarks of their respective owners. PRODUCT MODULES AND OPTIONS. This guide contains descriptions of modules that are optional and for which you may not have purchased a license. Siebel’s Sample Database also includes data related to these optional modules. As a result, your software implementation may differ from descriptions in this guide. To find out more about the modules your organization has purchased, see your corporate purchasing agent or your Siebel sales representative. U.S. GOVERNMENT RESTRICTED RIGHTS. Programs, Ancillary Programs and Documentation, delivered subject to the Department of Defense Federal Acquisition Regulation Supplement, are “commercial computer software” as set forth in DFARS 227.7202, Commercial Computer Software and Commercial Computer Software Documentation, and as such, any use, duplication and disclosure of the Programs, Ancillary Programs and Documentation shall be subject to the restrictions contained in the applicable Siebel license agreement. All other use, duplication and disclosure of the Programs, Ancillary Programs and Documentation by the U.S. Government shall be subject to the applicable Siebel license agreement and the restrictions contained in subsection (c) of FAR 52.227-19, Commercial Computer Software - Restricted Rights (June 1987), or FAR 52.227-14, Rights in Data—General, including Alternate III (June 1987), as applicable. Contractor/licensor is Siebel Systems, Inc., 2207 Bridgepointe Parkway, San Mateo, CA 94404. Proprietary Information Siebel Systems, Inc. considers information included in this documentation and in Siebel eBusiness Applications Online Help to be Confidential Information. Your access to and use of this Confidential Information are subject to the terms and conditions of: (1) the applicable Siebel Systems software license agreement, which has been executed and with which you agree to comply; and (2) the proprietary and restricted rights notices included in this documentation. Contents Siebel VB Language Reference 1 Chapter 1: What’s New in This Release Chapter 2: Siebel VB Overview Supported Uses of Siebel VB 17 Typographic Conventions 18 Chapter 3: Quick Reference: VB Statements and Functions Arrays in VB 19 VB Compiler Directives 20 Control Flow in VB 20 VB Date and Time Functions 21 Declarations in VB 22 VB Environment Control 23 VB Error Handling 24 VB File Functions: Disk and Folder Control 25 VB File Functions: File Control 25 VB File Functions: File Input/Output 26 VB Math Functions: Financial Functions 27 VB Math Functions: Numeric Functions 27 VB Math Functions: Trigonometric Functions 28 Objects in VB 29 ODBC Functions in VB 29 VB Strings: String Functions 30 VB Strings: String Conversions 31 Variants in VB 32 Siebel VB Language Reference Version 7.7 ■ 3 Contents Chapter 4: VB Language Overview VB Programming Hints 33 Conventions Used by Siebel VB 36 Arguments in VB 36 Named Arguments 37 Siebel VB Comments 37 VB Data Types 38 Arrays in VB 38 Numbers 39 Records 39 Strings 40 Type Characters 40 Data Type Conversions in VB 40 Dynamic Arrays in VB 41 VB Variant Data Type 42 VB Expressions 43 Numeric Operators 43 String Operators 43 Comparison Operators (Numeric and String) 44 Logical Operators 44 Object Handling in VB 44 Creating an Object Variable to Access the Object 45 Using Methods and Properties to Act on Objects 46 Error Handling in VB 46 Trapping Errors Returned by Siebel VB 46 Option 1: Trap Errors Within Body of Code 47 Option 2: Trap Errors Using an Error Handler 47 Trapping User-Defined, Non-Siebel VB Errors 48 Trapping Errors Generated by Siebel VB Methods 49 Siebel VB and Unicode 49 Chapter 5: VB Language Reference Abs Function 51 ActivateField Method 52 ActivateMultipleFields Method 52 ActiveBusObject Method 52 4 ■ Siebel VB Language Reference Version 7.7 Contents ActiveViewName Method 52 AddChild Method 52 Application_Close Event 53 Application_InvokeMethod Event 53 Application_Navigate Event 53 Application_PreInvokeMethod Event 53 Application_PreNavigate Event 53 Application_Start Event 53 Asc Function 53 Associate Method 54 Atn Function 54 BusComp Method 55 BusComp_Associate Event 55 BusComp_ChangeRecord Event 56 BusComp_CopyRecord Event 56 BusComp_DeleteRecord Event 56 BusComp_InvokeMethod Event 56 BusComp_NewRecord Event 56 BusComp_PreAssociate Event 56 BusComp_PreCopyRecord Event 56 BusComp_PreDeleteRecord Event 57 BusComp_PreGetFieldValue Event 57 BusComp_PreInvokeMethod Event 57 BusComp_PreNewRecord Event 57 BusComp_PreQuery Event 57 BusComp_PreSetFieldValue Event 57 BusComp_PreWriteRecord Event 57 BusComp_Query Event 58 BusComp_SetFieldValue Event 58 BusComp_WriteRecord Event 58 BusObject Method 58 Siebel VB Language Reference Version 7.7 ■ 5 Contents Call Statement 58 CCur Function 60 CDbl Function 61 ChDir Statement 62 ChDrive Statement 63 Chr Function 64 CInt Function 66 ClearToQuery Method 67 Clipboard Methods 67 CLng Function 68 Close Statement 69 Const Statement 70 Copy Method 71 Cos Function 71 CreateObject Function 72 CSng Function 74 CStr Function 75 CurDir Function 77 CurrencyCode Method 78 CVar Function 78 CVDate Function 79 Date Function 80 Date Statement 81 DateSerial Function 82 DateValue Function 83 Day Function 84 DeactivateFields Method 85 Declare Statement 85 Deftype Statement 88 DeleteRecord Method 89 Dim Statement 89 6 ■ Siebel VB Language Reference Version 7.7 Contents Dir Function 93 Do...Loop Statement 95 Environ Function 96 Eof Function 97 Erase Statement 98 Erl Function 100 Err Function 101 Err Statement 102 Error Function 103 Error Statement 104 ExecuteQuery Method 105 ExecuteQuery2 Method 105 Exit Statement 105 Exp Function 106 FileAttr Function 107 FileCopy Statement 109 FileDateTime Function 110 FileLen Function 110 FirstRecord Method 111 Fix Function 111 For...Next Statement 112 Format Function 114 FreeFile Function 121 Function...End Function Statement 122 FV Function 124 Get Statement 126 GetAssocBusComp Method 128 GetAttr Function 128 GetBusComp Method 129 GetBusObject Method 129 GetChild Method 129 Siebel VB Language Reference Version 7.7 ■ 7 Contents GetChildCount Method 129 GetFieldValue Method 129 GetFirstProperty Method 129 GetFormattedFieldValue Method 129 GetMultipleFieldValues Method 130 GetMVGBusComp Method 130 GetNamedSearch Method 130 GetNextProperty Method 130 GetObject Function 130 GetPicklistBusComp Method 132 GetProfileAttr Method 132 GetProperty Method 132 GetPropertyCount Method 132 GetSearchExpr Method 133 GetSearchSpec Method 133 GetService Method 133 GetSharedGlobal Method 133 GetType Method 133 GetUserProperty Method 133 GetValue Method 133 GetViewMode Method 133 Global Statement 134 GoTo Statement 137 GotoView Method 139 Hex Function 139 Hour Function 140 If...Then...Else Statement 141 Input Function 142 Input Statement 143 InsertChildAt Method 144 InStr Function 144 8 ■ Siebel VB Language Reference Version 7.7 Contents Int Function 146 InvokeMethod Method 148 IPmt Function 148 IRR Function 149 Is Operator 150 IsDate Function 151 IsEmpty Function 152 IsMissing Function 153 IsNull Function 154 IsNumeric Function 155 Kill Statement 156 LastRecord Method 157 LBound Function 158 LCase Function 159 Left Function 160 Len Function 161 Let (Assignment Statement) 162 Like Operator 163 Line Input Statement 164 Loc Function 166 Lock Statement 167 Lof Function 169 Log Function 170 LoginId Method 171 LoginName Method 171 LookupMessage Method 171 Lset Statement 171 LTrim Function 172 Me Object 173 Mid Function 174 Mid Statement 175 Siebel VB Language Reference Version 7.7 ■ 9 Contents Minute Function 177 MkDir Statement 178 Month Function 179 Name Method 180 Name Statement 181 New Operator 182 NewPropertySet Method 183 NewRecord Method 183 NextRecord Method 183 Nothing Function 183 Now Function 184 NPV Function 185 Null Function 186 Object Class 187 Oct Function 189 On...GoTo Statement 190 On Error Statement 190 Open Statement 192 Option Base Statement 194 Option Compare Statement 196 Option Explicit Statement 197 ParentBusComp Method 198 Pick Method 198 Pmt Function 198 PositionId Method 200 PositionName Method 200 PostChanges Method 200 PPmt Function 200 PreviousRecord Method 201 Print Statement 201 PropertyExists Method 202 10 ■ Siebel VB Language Reference Version 7.7 Contents Put Statement 203 PV Function 204 RaiseError Method 206 RaiseErrorText Method 206 Randomize Statement 206 Rate Function 207 ReDim Statement 208 RefineQuery Method 210 Rem Statement 210 RemoveChild() Method 211 RemoveProperty Method 212 Reset Method 212 Reset Statement 212 Resume Statement 213 Right Function 214 RmDir Statement 215 Rnd Function 216 Rset Statement 218 RTrim Function 219 Second Function 219 Seek Function 221 Seek Statement 222 Select Case Statement 224 SendKeys Statement 225 Service_InvokeMethod Event 228 Service_PreInvokeMethod Event 228 Set Statement