Computers & Technology vb-script

kidsgamesios lifestyleappsios wargamesios

Beheld Basal Software Tutorials - Tutorial Addendum - Capricious Analysis and Numeric About-face

 (Continued from antecedent part...)There are a amount of absorbing addendum here:Line V3 shows that (3.14) is appear as (Double). I was assured Single.Line V6 shows that (TRUE) is appear as (Num=Y). What amount True will be adapted to?Line S1 shows that ("777") is appear as (String) and (Num=Y). That is reasonable.Line S2 shows that ("3.14") is appear as (String), (Num=Y) and (Date=Y). What date "3.14" will be adapted to?Line A3 shows that a dynamic-size arrangement is not Abandoned even afore calling ReDim to set its size.Lines A1 to A5 appearance that arrays will never be Abandoned or Null.Lines E1 to E2 appearance that Abandoned and Absent are absolute data types and data literals.Line E2 shows that Abandoned is appear as (Num=Y). What amount Abandoned will be adapted to?Line O1 shows that (document) is an item of "HTMLDocument" type. This item is created by IE and anesthetized the IE VB Software environment.Parsing Continued IntegersA accepted assignment of administration user ascr... Read More by user

Beheld Basal Software Tutorials - Tutorial Addendum - Capricious Analysis and Numeric About-face

 (Continued from antecedent part...) document.writeln(" ") document.writeln("Checking arrays:") Dim aFixed(5) document.writeln("A1 " & GetVarInfo(aFixed) & " (Fixed)") aFixed(5) = 555 document.writeln("A2 " & GetVarInfo(aFixed) & " (Fixed/Val.)") Dim aDynamic() document.writeln("A3 " & GetVarInfo(aDynamic) & " (Dyn.)") ReDim aDynamic(3) document.writeln("A4 " & GetVarInfo(aDynamic) & " (Dyn./Set)") aDynamic(3) = "Dog" document.writeln("A5 " & GetVarInfo(aDynamic) & " (Dyn./Set/Val.)") document.writeln(" ") document.writeln("Checking emptiness:") vNull = Null document.writeln("E1 " & GetVarInfo(vNull) & " (Null)") vEmpty = Empty document.writeln("E2 " & GetVarInfo(vEmpty) & " (Empty)") document.writeln(" ") document.writeln("Checking objects:") document.writeln("O1 " & GetVarInfo(Document) & " (Document)")Function GetVarInfo(vAnyThing) If IsObject(vAnyThing) Then sObject = "Obj=Y" Else sObject = "Obj=N" End If If IsArray(vAn... Read More by user

Beheld Basal Software Tutorials - Tutorial Addendum - Capricious Analysis and Numeric About-face

 This affiliate describes:Variable InspectionVariable Analysis ExampleParsing Continued IntegersNotes and samples in this affiliate are based Beheld Basal 6.0.Variable InspectionIf are autograph a function, and accepting a capricious from the calling code, you can not consistently accept that the capricious is of assertive blazon and has amount assigned.If you cipher your action with such assumptions, your cipher will blast if the calling codefailed to accommodated those assumptions. To bigger assure your code, you wish to audit the capricious first, and address your cipher based on the aftereffect of the inspection. Capricious analysis can be performed at 3 altered levels:1. Actuate the anatomy blazon of the capricious like: object, array, or individual data.2. Actuate the data blazon of the capricious like, integer, long, double, date, Boolean, or String.3. Actuate the cachet of the data like, abandoned or not empty. VB offers a amount of congenital functions to advice you to audit a ... Read More by user

Beheld Basal Software Tutorials - Tutorial Addendum - Variables - Acknowledgment and Appointment

 (Continued from antecedent part...) c = 31 i = 777 l = 777777 f = 3.14159E+27 d = 3.33333E+202 y = 999999.5555 s = "Hello" b = True t = #12/31/1999 11:30:30 PM# v = "Variant: Any data type." MsgBox ( _ c & vbCrLf & _ i & vbCrLf & _ l & vbCrLf & _ f & vbCrLf & _ d & vbCrLf & _ y & vbCrLf & _ s & vbCrLf & _ b & vbCrLf & _ t & vbCrLf & _ v & vbCrLf)End SubRun the aloft code, you will get a bulletin box with the afterward output: 317777777773.14159E+273.33333E+202999999.5555HelloTrue12/31/1999 11:30:30 PMVariant: Any data type.No surprises in the output. But I haved used:A VB congenital constant, "vbCrLf", which represents appropriate characters, "Carriage Return" and "Line Feed", to breach the achievement bulletin into assorted lines."_" appearance to breach a VB account into assorted lines.Variable Absence ValuesIf you are apprehensive what are the absence ethics of absolutely declared variables of altered types,... Read More by user

Beheld Basal Software Tutorials - Tutorial Addendum - Variables - Acknowledgment and Appointment

 This affiliate describes:Variable DeclarationAssigning Ethics to VariablesVariable Absence ValuesVariable DeclarationLike some additional programming languages, Beheld Basal (VB) uses variables to assets memoryto abundance data and to name that anamnesis location. A capricious haveto be declared with a name and a specific data type. Actuality are the rules on capricious declaration:1. Absolute Acknowledgment - A capricious is declared with the "Dim" account in the afterward syntax: Dim variable_name As data_typewhere "variable_name" is a argument characterization to analyze this variable; and "data_type" is one of the data blazon key words: "Byte", "Integer", "Long", "Single", "Double", "Currency", "String", "Boolean", "Date", and "Variant". If a capricious is declared after "As" and the data blazon key word, it will be affected with the "Variant" data type.2. Absolute Acknowledgment - A capricious name is acclimated on the larboard ancillary of an appointment account after being decla... Read More by user

Beheld Basal Software Tutorials - Tutorial Addendum - Procedures - Functions and Subroutines

 (Continuedfrompreviouspart...)VariableScopeinProceduresVariableScope-Theareaofsourcecodewhereavariableisaccessible.Ifyouarenotusingprocedures,variablescopeisverysimple.Thescopeofavariableis:fromthestatementwhereitisdefinedtothelaststatementofthecode.Ifyouareusingprocedures,variablescopegetsmorecomplex.Herearesomebasicrules:1.Global-Ifavariableisdefinedinthemaincode,itsscopeisfromthestatementwhereitisdefinedtothelaststatementoftheentirecodeincludingallprocedures.2.Local-Ifavariableisdefinedinaprocedurecode,itsscopeisfromthestatementwhereitisdefinedtothelaststatementoftheprocedure.3.Collision-Ifavariableisexplicitlydefinedinaprocedurecodehasthesamenameasavariabledefinedinthemaincode,thevariableofthemaincodebecomein-accessiblewithinthisprocedure.Therearesomeinterestingconsequencesofthoserules:Thenicethingaboutrule#1isthatvariablesdefinedthemaincodeareautomaticallyaccessibleinallprocedures.Youdonthavetopassthemasreferenceargumentstosharetheminaprocedure.Thebadthingaboutrule#2isthatifyouare... Read More by user
Tags: accessible, basic, keyword, behavior, example, procedures, calling, functions, value, procedure, defined, notes, document, script, tutorial, grape, tutorials

Beheld Basal Software Tutorials - Tutorial Addendum - Procedures - Functions and Subroutines

 (Continued from antecedent part...)Here is the output: Test 1: Swapping two literals by value Afore Sub: Angel | Orange In Sub: Orange | Apple Afterwards Sub: Angel | OrangeTest 2: Swapping two variables by value Afore Sub: Dog | Cat In Sub: Cat | Dog Afterwards Sub: Dog | CatHere are my comments about this example:Test 1 is useless.Test 2 shows that "ByVel" arguments will not accompany any changes aback to the calling code.After the subroutine call, ethics in vFirst and vSecond accept not been afflicted at all.Passing Arrangement as ArgumentsAs I mentioned earlier, arrays can aswell be anesthetized as arguments. If an arrangement is anesthetized by reference, the action is alive on the aforementioned arrangement as the calling code. If an arrangement is anesthetized by value,the action is alive on a absolute archetype of the arrangement in the calling code.Here is an archetype cipher of using arrangement as an argument, function_reverse_array.html: <html><body><!-- func... Read More by user

Beheld Basal Software Tutorials - Tutorial Addendum - Procedures - Functions and Subroutines

 (Continued from antecedent part...)Example - Casual Arguments by ReferenceTo see how casual arguments by advertence works, I wrote the afterward example, function_swap_by_ref.html: <html><body><!-- function_swap_by_ref.html Absorb (c) 2006 by Dr. Yang. http://www.yang.com/--><pre><script language="vbscript"> document.writeln("") document.writeln("Test 1: Swapping two literals by reference") document.writeln(" Afore Sub: " & "Apple" & " | " & "Orange") Alarm SwapByRef("Apple", "Orange") document.writeln(" Afterwards Sub: " & "Apple" & " | " & "Orange") vFirst = "Dog" vSecond = "Cat" document.writeln("") document.writeln("Test 2: Swapping two variables by reference") document.writeln(" Afore Sub: " & vFirst & " | " & vSecond) Alarm SwapByRef(vFirst, vSecond) document.writeln(" Afterwards Sub: " & vFirst & " | " & vSecond)Sub SwapByRef(ByRef vLeft, ByRef vRight) vTemp = vLeft vLeft = vRight vRight = vTemp docume... Read More by user
Tags: basic, example, language, procedures, functions, value, orange, notes, document, script, tutorial, tutorials, arguments

Beheld Basal Software Tutorials - Tutorial Addendum - Procedures - Functions and Subroutines

 (Continued from antecedent part...)Sub Action ExampleHere is a abbreviate archetype of subroutines, function_sub.html: <html><body><!-- function_sub.html Absorb (c) 2006 by Dr. Yang. http://www.yang.com/--><pre><script language="vbscript"> Alarm Hello("Tom") Accost ""Sub Hello(sName) document.writeln("") document.writeln("Helo " & sName)End Sub</script></pre></body></html>Here is the output: Helo TomHelo Notice the two altered means of calling a subroutine.Rules of Casual ArgumentsAs apparent in antecedent examples, casual arguments to procedures seems to be a simple job. But it may couldcause abashing if you don t afterward the rules. VB Software has the afterward rules on passing arguments to procedures:1. By default, arguments are anesthetized by reference. In this case, an altercation name can be usedas a capricious that apropos (sharing) the aforementioned data as the calling code.2. But, arguments can be anesthetized by va... Read More by user

Beheld Basal Software Tutorials - Tutorial Addendum - Procedures - Functions and Subroutines

 (Continued from antecedent part...)Function Action ExampleTo advice you accept the abstraction of action procedure, I wrote the afterward the example, function_f2c.html: <html><body><!-- function_f2c.html Absorb (c) 2006 by Dr. Yang. http://www.yang.com/--><pre><script language="vbscript"> d = F2C(70.0) document.writeln("Received Celsius = " & d) d = F2C(212.0) document.writeln("Received Celsius = " & d)Function F2C(dFahrenheit) document.writeln("") document.writeln("Converting Fahrenheit = " & dFahrenheit) dCelsius = (dFahrenheit - 32.0 ) / 1.8 document.writeln("Returning Celsius = " & dCelsius) F2C = dCelsiusEnd Function</script></pre></body></html>Here is the output: Converting Fahrenheit = 70Returning Celsius = 21.1111111111111Received Celsius = 21.1111111111111Converting Fahrenheit = 212Returning Celsius = 100Received Celsius = 100Easy to understand. Right?Defining and Invoking Sub ProceduresA Sub Action is agna... Read More by user
Tags: basic, argument, procedures, functions, procedure, statement, notes, document, script, tutorial, tutorials

Beheld Basal Software Tutorials - Tutorial Addendum - Procedures - Functions and Subroutines

 This affiliate describes:What Is a Procedure?Defining and Invoking Action ProceduresFunction Action ExampleDefining and Invoking Sub ProceduresSub Action ExampleRules of Casual ArgumentsExample - Casual Arguments by ReferenceExample - Casual Arguments by ValuePassing Arrangement as ArgumentsVariable Ambit in ProceduresExample - Capricious ScopesNotes and samples in this affiliate are based Beheld Basal 6.0.What Is a Procedure?A Action is a assemblage of cipher alfresco of the capital beheading code. But it can be accomplished by an invoking account in the capital beheading code. There are 3 aspects about procedures:1. Defining a procedure.2. Invoking a procedure.3. Exchanging data amid the capital beheading cipher and a procedure.VB offers two types of procedures:1. Action Action - A action that allotment a amount explicitly.2. Sub Action - A action that does not acknowledgment any amount explicitly.Defining and Invoking Action ProceduresA "Function" account defines a action action wit... Read More by user

Beheld Basal Software Tutorials - Tutorial Addendum - Numeric Operations

 (Continued from antecedent part...)Double Amphibian Amount OperationsDouble amphibian amount operations are algebraic operations that: Operates on two bifold amphibian amount operands. If an operand is not a bifold amphibian number, it will be adapted into a bifold amphibian number.Produces a bifold amphibian amount by applying the algebraic operation defined by the operator.There are 5 bifold amphibian amount operations accurate in VB:Addition (+): Algebraic sum of both operands.Subtraction (-): First operand subtracted by the additional operand. Multiplication (*): First operand assorted by the additional operand.Division (/): First operand disconnected by the additional operand.Exponentiation (^) - First operand aloft to the ability of the additional operand. To appearance you how bifold amphibian amount operations work, I wrote the afterward script, floating_operation.html: <html><body><!-- float_operation.html Absorb (c) 2006 by Dr. Yang. http://www.yang.com/-->&... Read More by user

Beheld Basal Software Tutorials - Tutorial Addendum - Numeric Operations

 This affiliate describes:Long Accumulation OperationsDouble Amphibian Amount OperationsNumeric Operations on Additional Data TypesNotes and samples in this affiliate are based Beheld Basal 6.0.Long Accumulation OperationsLong accumulation operations are numeric operations that: Operates on two continued accumulation operands. If an operand is not a continued integer, it will be adapted into a continued integer.Produces a continued accumulation by applying the algebraic operation defined by the operator.There are 6 continued accumulation operations accurate in VB:Addition (+): Algebraic sum of both operands.Subtraction (-): First operand subtracted by the additional operand. Multiplication (*): First operand assorted by the additional operand.Division () - Accomplished amount division: First operand disconnected by the additional operand with decimal atom allotment removed. Remainder (Mod) - Butt division: The actual amount of the accomplished amount division.Exponentiation (^) - First ... Read More by user

Beheld Basal Software Tutorials - Tutorial Addendum - Bend Statements

 (Continued from antecedent part...)"Do ... Loop" StatementsPersonally, I anticipate that two types of loops, "For ... Next" and "While", are abundant for any bend programming situations. But the designers of VB absitively to accord us an added blazon of loops, "Do ... Loop" statements, with the afterward different flavors:1. "Do While ... Loop" Statements Do While condition statement_block LoopThey are identical logically to: While condition statement_block Wend2. "Do Until ... Loop" Statements Do Until condition statement_block LoopThey are identical logically to: While Not condition statement_block Wend3. "Do ... Bend While" Statements Do statement_block Bend While conditionThey are identical logically to: statement_block While condition same_statement_block Wend4. "Do ... Bend Until" Statements Do statement_block Bend Until conditionThey are identical logically to: statement_block While Not condition same_statement_block WendI will leave it to you to address some sample scripts for ... Read More by user
Tags: basic, block, statements, condition, statement, notes, script, tutorial, tutorials

Beheld Basal Software Tutorials - Tutorial Addendum - Bend Statements

 (Continued from antecedent part...)Here is the output: Found a prime number: 3Found a prime number: 5Found a prime number: 7Found a prime number: 11Found a prime number: 13Found a prime number: 17Found a prime number: 19Found a prime number: 23Found a prime number: 29The achievement looks good. Some addendum about the sample script:Nested loops, one bend central addition loop, are used.The alien bend goes through integers amid 3 and 20, and skips even numbers with "Step 2"The close bend goes determines if the accepted accumulation "i" is a prime or notThe close bend has a codicillary "Exit For" account to abolish the bend as anon as "i" has been bent as a non-prime number."While" StatementsAnother blazon of bend statements is alleged "While" statement, which has the afterward syntax: While condition statement_block (multiple statements) Wendwhere "condition" is a Boolean value.The way a "While" account is accomplished looks like:Step 1: Analysis Boolean amount of "condition".Step 2: If... Read More by user

Beheld Basal Software Tutorials - Tutorial Addendum - Bend Statements

 This affiliate describes:"For ... Next" Statements"For ... Next" Account Example"While" Statements"While" Account Example"Do ... Loop" Statements"For ... Next" Statements"For ... Next" is apparently the alotof frequently acclimated bend account in VB. Actuality is its syntax: For loop_variable = initial_value To final_value [Step interval] statement_block (multiple statements) Nextwhere "loop_variable" is a acting capricious acclimated to ascendancy the loop, "initial_value" is the initial amount to be assigned to the bend variable, "final_value" is the high apprenticed to stopthe loop, and "interval" is the breach that controls how the bend capricious to be updatedat anniversary iteration. Agenda that if "interval" is not specified, "1" will be acclimated as the interval.If you wish to understand absolutely how the "For ... Next" account will be executed, actuality is my understanding:Step 1: "intial_value" is assigned to "loop_variable".Step 2: Comparing the accepted amount of "loop_... Read More by user
Tags: basic, example, final, statements, value, statement, notes, script, tutorial, tutorials

Beheld Basal Software Tutorials - Tutorial Addendum - Allegory and Argumentation Operations

 (Continued from antecedent part...)Logical OperationsLogical operations are operations that: Operates on one Boolean operand or two Boolean operands.Produces a Boolean amount by applying the analytic operation defined by the operator.There are 4 analytic operations accurate in VB:Logical add (Add): Consistent (True) if both operands are (True).Logical or (Or): Consistent (True) if one of the operands is (True).Logical not (Not): Consistent (True) if the operand is (False).Logical xor (Xor): Consistent (True) if one and alone one operand is (True).To appearance you how analytic operations work, I wrote the afterward script, logical_operation.html: <html><body><!-- logical_operation.html Absorb (c) 2006 by Dr. Yang. http://www.yang.com/--><pre><script language="vbscript"> document.writeln(True And True) document.writeln(True Or True) document.writeln(Not True) document.writeln(True Xor True)</script></pre></body></html>Here is the out... Read More by user

Beheld Basal Software Tutorials - Tutorial Addendum - Allegory and Argumentation Operations

 This affiliate describes:Numeric ComparisonsLogical OperationsNotes and samples in this affiliate are based Beheld Basal 6.0.Numeric ComparisonsNumeric comparisons are operations that: Operates on two numeric operands.Produces a Boolean amount by applying the allegory operation defined by the operator.There are 6 numeric allegory operations accurate in VB:Equal to (=): Consistent (True) if two operands are numerically equal.Not according to (<>): Consistent (True) if two operands are numerically not equal.Greater than (>): Consistent (True) if the first operand is numerically greater than the additional operand. Less than (<): Consistent (True) if the first operand is numerically beneath than the additional operand.Greater than or according to (>=): Consistent (True) if the first operand is numerically greater than orequal to the additional operand.Less than or according to (<=): Consistent (True) if the first operand is numerically beneath than orequal to the additio... Read More by user
Tags: basic, operation, greater, operations, notes, document, script, tutorial, tutorials, second

Beheld Basal Software Tutorials - Tutorial Addendum - Quick Addition of Beheld Basal

 (Continued from antecedent part...)Now let s try to address our first VB Software in a HTML document. 1. Accessible the Block to access the afterward HTML document: <html><body><script language="vbscript"> document.write("Hello world! - VB Script")</script></body></html>2. Save the HTML certificate as hello_vb.html.3. Appearance the HTML certificate with IE. You should see the afterward bulletin in the IE window: Hello world! - VB ScriptCongratulations. You accept auspiciously accounting a VB Software in a HTML document!What happened actuality was: We accept added a "script" tag in our HTML document, hello_vb.html.We included one VB account central the Software tag.That VB account calls the "document.write" function, which is a action provided by IEto admit a argument cord into the HTML document.We ran IE to appearance hello_vb.html and got absolutely what we expected.Using Beheld Basal aural Microsoft AccessMicrosoft Admission is a Microsoft applian... Read More by user

Beheld Basal Software Tutorials - Tutorial Addendum - Quick Addition of Beheld Basal

 This affiliate describes:What Is Beheld Basic?Using Beheld Basal aural Internet ExplorerUsing Beheld Basal aural Microsoft AccessWhat Is Beheld Basic?Visual Basal (VB) - A programming accent developed by Microsoft for Microsoft Windows environment. The accepted adaptation is Beheld Basal 6.0.Visual Basal can be acclimated in two ways:1. Autograph angle abandoned applications on Microsoft Windows systems. 2. Autograph add-on scripts aural Microsoft applications.To address angle abandoned applications in VB, you charge the Microsoft Beheld Basal software, which provides you a development ambiance for entering, debugging, and accumulation your applications.To address add-on scripts in VB aural additional Microsoft applications, you charge to chase the blueprint of the hosting application. Usually, the hosting appliance will: Provide you a specific syntax to access and abundance your VB scripts. Provide you an interface to let your scripts to collaborate with the host application.Restrict ... Read More by user

 

 

Pages :  1 2