Yuav Ua Li Cas Sau Ntawv Vbs Tsab Ntawv

Cov txheej txheem:

Yuav Ua Li Cas Sau Ntawv Vbs Tsab Ntawv
Yuav Ua Li Cas Sau Ntawv Vbs Tsab Ntawv

Video: Yuav Ua Li Cas Sau Ntawv Vbs Tsab Ntawv

Video: Yuav Ua Li Cas Sau Ntawv Vbs Tsab Ntawv
Video: Yuav ua li cas thiaj thov tau daim ntawv tso cai los qhib business nyob rau lub nroog Minneapolis 2024, Kaum ib hlis
Anonim

Kev muaj peev xwm tshwj xeeb hauv Windows tau txais kev txhawb nqa ntawm qib ua haujlwm. Lawv tau muab los ntawm Windows Script Host feem, uas muaj peev xwm los ua cov ntawv sau hauv ntau hom lus programming. Thaum pib, OS xa tawm teeb suav nrog tus txhais lus rau JScript thiab VBScript lus. Qhov kawg yog qhov tseem ceeb yog siv los tsim vbs ntawv sau uas daws cov tswj hwm thiab cov neeg siv haujlwm tswj hwm.

Yuav ua li cas sau ntawv vbs tsab ntawv
Yuav ua li cas sau ntawv vbs tsab ntawv

Tsim nyog

cov ntawv nyeem editor

Cov Lus Qhia

Kauj ruam 1

Tshawb cov yam ntxwv thiab lub peev xwm ntawm lub sijhawm rwj ua si nyob rau hauv uas tsab ntawv tsim yuav tsum ua haujlwm. Piv txwv, yog tias ib tsab ntawv npaj los rau hauv cov nplooj ntawv web, nws yuav cuam tshuam ntau yam nrog browser hom qauv thiab daim ntawv tam sim no (BOM thiab DOM). Cov ntawv sau tau tsim los ua haujlwm hauv Windows Script Host (piv txwv li, kom ua haujlwm rau kev tswj hwm cov haujlwm) yuav cuam tshuam nrog nws cov qauv txheej txheem, dhau los ntawm lawv tau yooj yim tsim thiab siv lwm yam khoom siv ActiveX thiab COM.

Kauj ruam 2

Tsim cov algorithms uas yuav siv los tsim cov haujlwm tseem ceeb ntawm tsab ntawv. Siv kev paub txog cov peev xwm uas muab los ntawm qhov xwm txheej ib puag ncig. Txheeb xyuas feem ntawm cov lej txheej txheem uas tuaj yeem ua raws li tus txheej txheem ntawm kev ua haujlwm, kev ua haujlwm, hom ntawm cov chav kawm. Txheeb xyuas cov ntaub ntawv uas tuaj yeem ua nyob rau hauv cov chav kawm.

Kauj ruam 3

Ua lub ntsej muag kiag rau tsab ntawv tom ntej. Hauv kab lus hloov kho, tsim cov ntawv sau. Ntxiv cov nuj nqi thiab cov txheej txheem "tsub" rau nws, nrog rau cov lus tshaj tawm hauv chav kawm uas muaj lawv cov hau kev. Tus txheej txheem hauv VBScript yog tshaj tawm nrog Sub cov lus tseem ceeb uas ua tom qab los ntawm tus cim uas qhia meej nws lub npe. Qhov kawg ntawm cov txheej txheem lub cev tau qhia los ntawm End Sub clause. Piv txwv li:

Kom MyProcedure (a, b)

Xaus Sub

Ib yam li ntawd, kev khiav dej num tau tshaj tawm siv Kev Siv Lo Lus:

Muaj nuj nqi MyFunction (a)

Tus Kawg Tas

Cov chav kawm raug tshaj tawm uas siv Chav Kawm lo lus tseem ceeb:

Chav Kawm MyClass

Xaus Chav Kawm

Kauj ruam 4

Tshaj tawm thoob ntiaj teb, thaj chaw hauv zos thiab cov tub kawm sib xyaw. Qhov no yog ua nrog Dim txoj cai:

Dim MyVariable

Los ntawm kev txheeb xyuas qhov pom tseeb tom qab lub npe ntawm cov kuj sib txawv, koj tuaj yeem tshaj tawm txog arrays:

Dim MyArray (10) 'kaum ntawm kaum lub ntsiab;

Dim MyArray (10, 15) 'ob-seem kab sib chaws;

Dim MyArray () 'dynamic array.

Kauj ruam 5

Siv cov ntaub ntawv ua cov txheej txheem algorithm los ntawm kev ntxiv cov cai rau cov haujlwm, cov txheej txheem thiab cov txheej txheem hauv chav kawm. Siv Ua Ua - Voj, Thaum, - Wend, Rau - Txhua - Tom ntej, Rau - Rau - Kauj Ruam - Cov kab txuas ntxiv los tsim cov loops. Siv Qhov Yog tias - Tom qab ntawd - ElseIf - Lwm Yam - Kawg Yog clause li tus neeg teb xov tooj txiav thiab xaiv qhov Case - End Xaiv clause ua tus xaiv ntau yam.

Kauj Ruam 6

Ntxiv cov lus rau qhov chaws. Lawv yuav tsum tuaj tom qab ntawm lub cim tsocai lossis cov ntsiab lus Rem. Piv txwv li:

'saib kab ntawv

Cov lus pom rov qab

Pom zoo: