Академический Документы
Профессиональный Документы
Культура Документы
Siebel VB Syntax
Introduction
Data Types Dimensioning Variables Operators Decisions Looping Functions and Subroutines Arrays in Siebel VB Some Important VB Methods sing Siebel Ob!ects "rror #andling in Siebel VB
Comments in Siebel VB
$This is a (omment
Data Types
Operators
Mathematical Operators
(onditional Operators
Logical Operators
Assignment
Dimensioning Variables
Syntax'
"xamples'
Dim sLast)ame+ sFirst)ame As String Only last 5ariable gets speci%ied data type' others are type Variant
(annot initiali6e
Decisions: If
Syntax'
I% (ondition Then
"xample'
s9rade 2 :Fail;
"nd I%
Decisions: lse
Syntax'
I% (ondition Then
"lse
"xample'
"lse
"nd I%
Decisions: lse If
"xample'
I% iScore 3 78 Then
"lse
"nd I%
Select Var)ame
(ase First(ase (ase )ext(ase (ase "lse
"nd Select
(ase Is 3 78
(ase Is 42 <88
(ase "lse
"nd Select
Syntax'
"xample'
)ext i(tr
!ooping: Do !oop
Syntax'
Do
Loop
"xample'
i(tr 2 8 Do
i(tr 2 i(tr . < sStep)um 2 :Step )umber' : > Str?@i(trA
Loop
Syntax'
Bhile (ondition
"xample'
bcSCD)extCecord
Bend
A Function returns a 5alue A Subroutine does not "ither can ha5e data passed into them as parameters
se ByVal or ByCe% By de%ault+ Ob!ects are passed by re%erence Simple data types are passed by 5alue
Subroutines
Syntax'
"xample'
"nd Sub
Calling Subroutines
Syntax'
(all Sub)ame Value<+ Value= $(all FeyGord is optional (all Set)ame :9eorge Bush; Set)ame :9eorge Bush;
"xamples'
"unctions
Syntax'
"nd Function
"unctions
"xample'
"nd Function
Calling "unctions
Syntax'
Var 2 Func)ame@ValueA Sub)ame @Func)ame@ValueAA Dim s)ame as String s)ame 2 9et)ame FindValue@9et)ameA $FindValue is some other sub that ta&es a string as a parameter
"xample'
"xample ='
%rrays
Dimensioning'
CeDim' sed %or dynamic arrays LBound+ Bound' Ceturn loGer or upper bound o% array "rase' Ceinitiali6e array
)oG Asc Val Str? Le%t?+ Mid?+ Cight? File #andling in Siebel VB
'ow
Ceturns (urrent Time and Date on machine that the script is running on
Cunning Beb (lient or Bireless Beb (lient+ that is the Siebel Ser5er that the AOM is running on Cunning Mobile Beb (lient or Dedicated Beb (lient+ that is the machine that SiebelDexe is running on* the clientHs machine
%sc
Ta&es a string as argument Ceturns the AS(II 5alue o% the %irst char in the string se%ul %or determining Ghether input is 5alid I you can chec& to see i% it is an alphabetic character+ a numeric character+ or anything else
Val ta&es a String argument that is made up o% numbers @iDeD :<8;A and returns its numeric 5alue Str? ta&es a numeric argument and con5erts it to a string
String &anipulation
Le%t? Ta&es a string and an integer argument Ceturns a substring o% the string passed in Cight? is same+ but returns the substring %rom the right Mid? Ta&es a string and = integersD It returns a substring o% the length o% the second integer+ starting at the character indicated by the %irst
"ile )andling
Open Statement Line Input Statement "o% Function Brite Statement (lose Statement
Opening "iles
Syntax'
Open :-ath0Filename; For Input @OutputA As J Open :('0MyFileDtxt; For Input As J< Open :D0log0"rrorDlog; For Output as JK
"xamples'
See Also' Input Stmt+ Input Function+ 9et Stmt Line Input JFile)um+ Var)ame Open :(0MyFileDtxt; For Input As J<
Syntax'
"xample'
Loop
(lose J<
of "unction
Ta&es the number o% an open %ile as argument Ceturns true i% %ile pointer is at the end o% the %ile
#rite Statement
"xample'
For i(tr 2 8 to
Bound@MyArrayA
)ext i(tr
(lose J=
Close Statement
(lose JFile)um
Syntax'
"xample'