Beranda > PEMROGRAMAN > ASP TUTORIAL – VBSCRIPT LOOP STATEMENT

ASP TUTORIAL – VBSCRIPT LOOP STATEMENT

Looping digunakan untuk mengulang-ulang suatu blok pernyataan/action berdasarkan kondisi tertentu

Dalam Pemrograman ASP/VBScript dikenal beberapa pernyataan looping antara lain:

* Do…Loop

* While…Wend

* For…Next

* For Each…Next

Do…Loop

Pernyataan do…loop digunakan untuk perulangan berdasarkan suatu parameter kondisi yang harus terpenuhi, ada 2 bentuk perulangan do…loop ini berdasarkan penempatan parameter kondisi yaitu parameter kondisi di letakkan di awal pernyataan dan parameter kondisi di letakkan di akhir pernyataan. Syntax dari pernyataan do…loop sbb:

Do [While | Until] Kondisi

[Action]

[Exit Do]

[Action]

Loop

Atau

Do

[Action]

[Exit Do]

[Action]

Loop [While | Until] Kondisi

Perbedaan dari kedua pernyataan do…loop diatas:

* Parameter Kondisi diletakkan diawal pernyataan Evaluasi kondisi dilakukan sebelum loop, sehingga Jika kondisi tidak terpenuhi maka action yang ada didalam blok perulangan tidak akan di eksekusi.

* Parameter Kondisi diletakkan di akhir pernyataan Evaluasi kondisi dilakukan setelah loop, sehingga paling tidak blok action di eksekusi sekali baru kemudian di evaluasi apakah looping dilanjutkan atau tidak.

Contoh :

i = 0

do while i<10
Response.Write(i&”
“)

i=i+1

Loop

x = 0

do until x=10

Response.Write(x)&”

x=x+1

Loop

Kedua blok do..loop diatas akan menghasilkan angka 0 sampai dengan 9.

Pernyataan Exit Do digunakan untuk keluar dari blok perulangan meskipun kondisi perulangan masih memenuhi.

While..Wend

Perulangan While…Wend memiliki fungsi yang sama dengan Do While…Loop. Evaluasi kondisi selalu dilakukan di awal pernyataan. Syntax :

While Kondisi

[Action]

Wend

Contoh:

i = 0

while i<10
Response.Write(i&”
“)

i=i+1

Wend

Contoh diatas adalah bentuk while…wend dari contoh do while…Loop di section pertama tadi.

For..Next

Perulangan For..Next berfungsi untuk melakukan pengulangan blok action berdasarkan nilai awal dan akhir, dengan kata lain range looping ssudah diketahui. additional Step options berfungsi untuk menambahkan atau mengurangi variable nilai. Syntax :
For Nilai_Awal to Nilai_Akhir [Step Nilai_Langkah]

[Action]

[Exit For]

[Action]

Next

Silahkan jalankan contoh script berikut untuk langsung dapat melihat dan memahami cara kerja loop for..next [step]

For i=0 to 10

Response.Write(i&”
“)

Next

For i=0 to 10 step 2

Response.Write(i&”
“)

Next

For i=10 to 1 step -1

Response.Write(i&”
“)

Next

For Each…Next

Perulangan For Each Next digunakan untuk melakukan perulangan blok action untuk setiap element yang ada di dalam group/array atau koleksi. perulangan ini sangat berguna untuk array dan object koleksi.

Syntax :

For Each element In Group

[Action]

[Exit For]

[Action]

Next

Setiap kali eksekusi maka akan diambil nilai element dari group/array/koleksi yang didefinisikan dalam blok pernyataan untuk di-ikutkan didalam blok action/proses di dalam loop.

Contoh:

arr1 = array(1,2,3,4,5,6)

For Each nilai in arr1

Response.Write(nilai&”
“)

Next

arr2=array(“Lahir”,”Hidup”,”Mati”)

For Each sItem in arr2

Response.Write(sItem&”
“)

Next

Sumber :
KOMUNITAS PELAJAR ILMU KOMPUTER INDONESIA
http://mr-amateur.co.cc

Kategori:PEMROGRAMAN
  1. Februari 12, 2013 pukul 6:46 am

    Whats up very cool website!! Man .. Beautiful .. Wonderful .
    . I’ll bookmark your website and take the feeds also? I’m glad to
    find so many helpful info here in the publish, we’d like develop more techniques in this regard, thanks for sharing. . . . . .

  2. Februari 13, 2013 pukul 11:03 pm

    Where did u acquire the techniques to write ““ASP TUTORIAL – VBSCRIPT LOOP STATEMENT
    ILMU KOMPUTER”? Thanks for your time ,Barry

  3. Januari 24, 2014 pukul 2:00 am

    Peu importe où vos goûts de jeux peuvent fixer , vous serez Assurez-vous de trouver
    quelque chose pour aiguiser votre appétit pour la concurrence numérique .
    peu importe comment simple ou complexe dans la nature , ils ont la capacité de tenir une personne , peu importe l’âge ou il est jeune , à
    eux pour nombre infini d’heures . Si vous préférez les jeux de «
    piste de course » plutôt que des environnements de conduite urbaine ,
    jalada Ultimate Racing pourrait bien être le jeu pour vous .

  4. Februari 17, 2014 pukul 8:49 am

    When you jailbreak or unlock a gadget, you’re chaining
    some fundamental aspects of the system software-you know, real low-level stuff.
    The resources are generally great, and if you adhere to directions carefully,
    you ought to be fine. But if some thing goes wrong-and there
    is much more than 1 way this can happen-you can suffer data reduction,
    or even brick your phone. Even even worse, Apple
    statements that jailbreaking voids your warranty. You can restore your gadget to remove proof that it at
    any time occurred, but if the gadget goes down while jailbroken, you could well be caught.

    In addition, jailbreaking does not jibe with the DMCA,
    and breaks relate license agreements.

    This 3D shooter is a mirror of the popular 1990’s strike classic Wolfenstein.
    The game perform has sixty different ranges that mix puzzle fixing and
    killing Nazi’s. The depth on this game is great for a initial person shooter on the iPhone, the controls are also extremely simple to use.

    Angry customers, in an uproar more than the
    overall performance of the new Maps app, flooded Twitter
    and forums with grievances about Apple maps. Other than the
    bad performance, one of the important failures of this feature was inaccurate information
    of numerous places. It situated incorrect addresses, mislabeled cities,
    and did not even offer transit instructions.

    The newest jailbreak gives customers accessibility to almost all GSM network, which functions overseas and might be much more
    practical in your vicinity. Somebody might understand jailbreak and unlock as same phrases.
    In fact, Jailbreak and unlock are two various techniques.
    Jailbreak for Iphone indicates you are allowed to set
    up 3rd party programs on your Iphone. For unlock, it refers to the procedure to open up up your Apple iphone to allow all carriers.
    So, they are totally various.

    Today you will discover selection of cases out there specially developed for iPad.

    But you ought to choose the one that will best suit your character as nicely as your iPad.
    Before purchasing an iPad case you have to determine your spending budget.

    There are each costly and cheap iPad addresses available.
    Nevertheless, there are also some ideal and
    affordable iPad cases accessible that will certainly fulfill your needs.

    If you are ready to spend some cash then there are wide selections of beautiful, attractive, and luxurious instances available for
    your new iPad. But there are certain things that you have
    to think about whilst buying leading rated ipad instances.

    After I manage to get out of mattress I usually go downstairs to allow the dogs out.
    While I’m waiting on them, I’m examining my emails and messages, followed by my Twitter and fb updates.
    There are numerous options for checking Twitter on the Apple iphone.
    I have examined numerous of them, and they all have their good
    and bad factors. For me, though, TweetDeck for the Apple iphone (http://bit.ly/aNfDMq) is the
    best of both worlds. I can verify facebook and Twitter at the exact same time, side by side,
    with out launching a new software.

    So consumer has been lefts with numerous options. If they want to carry
    on with 3G they have previous edition of Iphone and iPad with inexpensive price tag or subsequent era which consists
    of 4G with Apple iphone five and iPad 2.

  5. Februari 18, 2014 pukul 6:43 pm

    According to iTechPost, Wal-Mart is giving us a sure signal that the Iphone 5 is
    on the way. On Sept. two they noted that Wal-Mart has dropped
    the Iphone five price from $128 to $98. It’s not a monumental cost drop, but we all know what it means: Time to clear the shelves for the newest Apple should-have device.

    Ipad is an additional gadget from Apple, which received impressive
    response from globe broad. Ipad comes with a beautiful design.
    Ipad comes with a nine.7+ big show display. We can say this higher resolution display display
    tends to make Ipad attractive. Home button is placed just bellow the display screen.
    A simple push on that home button will take you back again to the house web page anytime.
    ipad got a various placement for volume control buttons.
    Buttons are placed in the left aspect of Apple iphone.
    iPad buttons are coming at the correct side of the screen.
    ipad ulcok display appears exact same like iphone.
    Ipad consists of all the applications in iphone.Ipad programs received higher perfomance than apple iphone.

    The newest jailbreak gives users access to nearly
    all GSM community, which functions overseas and may
    be much more functional in your vicinity. Somebody might understand
    jailbreak and unlock as same words. In reality, Jailbreak and
    unlock are two various techniques. Jailbreak for Iphone means you are
    permitted to set up third celebration applications on your Iphone.
    For unlock, it refers to the process to open up your Apple iphone
    to allow all carriers. So, they are totally various.

    While apps like The Climate Channel and CNN Cellular can assist you in working day-to-day lifestyle,
    applications like Angry Birds can make sure that you don’t get bored
    performing absolutely nothing. Most of the apps given here can be downloaded for free, but
    you will have to invest some cash for other apps. Other than these
    should-have applications for iPhone four, Application Store also
    offers some other Iphone downloads which can make your Apple iphone encounter
    a memorable 1.

    Throughout my lifestyle I have rationalized it with a easy financial
    argument. Whenever pressed for my opinion on this or that Apple emblem’d digital computing gadget,
    it was usually far more expensive than a competitors quicker, much more configurable/ less restrictive device with out that emblem.

    Because MacOSX, I have also recommended that the Apple logo denotes a fair measure of reliability
    and usability, if you are prepared to make that trade.
    When the person inquiring was more than the age of 48, a graphic artist,
    or musician my guidance was condensed to, “Buy it!”. My own
    electronics spending budget for numerous years was, shall we say, not Apple conducive.
    Difficult to justify 1 Mac versus a couple three Linux PCs.

    The surprise wasn’t the iPad mini, which was well-recognized, but that
    Apple wasn’t announcing a tweaked iPad 3, but instead
    a fourth-generation iPad. That’s correct, Apple has
    turned the iPad refresh cycle upside-down, by moving it from
    March / April to October.

    But you ought to know that this is not as simple as you may have expected it to be.
    As you already know, there are a lot of sites that you can select from.
    But if you want to be particular that you will get a good
    services, it is a lot much better if you will accessibility the formal Mypadmedia store.
    This is actually 1 of the best things that you can do so that you can accomplish this task.

    Shipping in November, the 21.5-inch iMac 2.7GHz quad-main i5, 8GB RAM, GeForge GT 640M,
    1TB High definition, $1,299. Transport in December, the 27-inch iMac, 2.9GHz
    quad-core i5, 8GB RAM, GeForce GTX 660M, 1TB Hd, $1,799.

    Were Zansys Technologies. Had been into app improvement.
    And we can provide you a great pricing and quality if it is about
    Iphone application improvement. Had been also into Android application development and Blackberry application development.
    You can check out much more about us and our portfolio on our web site.

  6. Februari 23, 2014 pukul 1:13 am

    Visas issued too seasonal foreign workers went downn 52percent in 2010.

    Should none of this serve to resolve your dispute and your case revolves around a matter where you are protected bby the law, like discrimination, your next step would be to
    seek legal assistance. Spaanish is a good choice, because of the growing hispanic ppulation in America.

  7. Maret 15, 2014 pukul 9:06 am

    It could be between two customers or via a Chat team.

    It is generally more advantageous to people who know the fundamentals of playing guitar.
    It will be saved right here: /sdcard/WhatsApp/Database.

  8. Maret 26, 2014 pukul 9:24 am

    When designing your personal apps, you require to know the basics of
    how to make cash out of it. You can also access your pictures, movies, and songs from any computer, phone, or pill.

  9. April 7, 2014 pukul 7:15 pm

    This Really Is sad and can be avoided if caught in
    time. In today’s day we have several high-protein diets to pick from.
    Astragalus was called huang qi in traditional Chinese medicine.

  10. April 21, 2014 pukul 5:16 am

    The movie is approximately giving him back and securely finding Ryan in the middle of warfare.
    Lots of web pages which you’re going to find video downloads on are usually scams or bogus.

  11. April 23, 2014 pukul 6:10 pm

    math games will not modify the necessity for a teacher.
    And then obviously there are snakes and ladders at reasonable times.
    The characters and plot can get in very interesting directions.

  12. April 30, 2014 pukul 2:09 pm

    This will direct you into a new site, when you’ll begin to
    see the details of the software that you selected. If you ‘Tweet as you consider’, this is a
    must have application. IPhone development tools are also accessible online.

  13. Mei 3, 2014 pukul 4:18 am

    Do you realize that you do not need certainly to wait too long for the
    jailbreaking process to accomplish. Or I cheat on crosswords by looking up the answer
    online when I figure it out myself and may be patient.

  14. Mei 15, 2014 pukul 11:47 pm

    We are restaurant furniture closeouts hoping thuat Lalla’s new administration can flip the brandd name about.
    Another way which is my interior design business.

    It would, yeah. In short, you need to delve into the material that you ned too give importance to toddlers, too.
    Spend 10 too 15 mph 16.

  15. Mei 19, 2014 pukul 2:33 am

    The more secure is the better, as you don’t want someone finding out that you’re monitoring the telephone.
    Without it, it’s a far more iffy proposition. The handset
    is sleek and beautiful when it arrives to style.

  16. Mei 22, 2014 pukul 7:24 pm

    These centers provide outstanding piece of baby games that produce your child happy.
    Attendees can suppose how many items come in the jar. Robeez shoes slipon, enabling comfort and ease.

  17. Mei 30, 2014 pukul 8:34 pm

    The good news is that you can improve your iPhone fairly effortlessly by simply promoting
    your utilized iPhone. The usability of this unique gadget
    can even be improved through unlocking and jailbreaking.

  18. Juni 11, 2014 pukul 6:38 am

    You may find that using several types of ammunition for-one fortress
    is the best approach to crush it. So let’s have a look in the 10 best
    pcgames ever. The socks are so small that they are constantly getting lost.

  19. Juni 14, 2014 pukul 11:30 am

    Apple has generated into its new product a mini-dock, with
    dramatically less pins. Listing of expenditures by
    the average person doesn’t really apply here. This could additionally help with
    your call producing process.

  20. Juni 19, 2014 pukul 3:43 am

    This excellent website truly has all the information I needed about this subject and didn’t know
    who to ask.

  21. Juli 8, 2014 pukul 7:59 am

    Truly no matter if someone doesn’t be aware of then its up
    to other users that they will assist, so here it occurs.

  22. Juli 8, 2014 pukul 11:24 am

    Have you ever considered about including a little bit
    more than just your articles? I mean, what you say is important and all.
    However think about if you added some great photos or videos to give your posts more, “pop”!
    Your content is excellent but with images and video clips, this website could definitely be one of the greatest in its field.
    Superb blog!

  23. Juli 10, 2014 pukul 10:32 am

    WOW just what I was searching for. Came here by searching for annuity
    cash

  24. Juli 18, 2014 pukul 11:10 am

    Thankfulness to my father who informed me concerning this blog, this webpage is really remarkable.

  25. Agustus 3, 2014 pukul 7:12 am

    Hi! I could have sworn I’ve been to this website before but after
    checking through some of the post I realized it’s new to me.
    Anyways, I’m definitely glad I found it and I’ll be book-marking and
    checking back often!

  26. Agustus 13, 2014 pukul 9:53 pm

    Good replies in return of this question with firm arguments and describing all concerning that.

  27. Agustus 22, 2014 pukul 12:32 pm

    Yes! jailbreak is a easy and secure too. Find the choice of “Install Package Files” in the “Game Menu”, and then choose “manager.pkg”.
    Darkness is an interesting application that’s ostensibly an sophisticated globe
    clock.

  28. Agustus 22, 2014 pukul 12:40 pm

    Back up your gadget to your iTunes library, and sync it.

    This game is a should for Boggle or Scrabble enthusiasts.
    You will soon understand how useful it is by the vast array of programs that are offered
    through the Apple shop.

  29. Agustus 30, 2014 pukul 10:37 pm

    After looking over a few of the articles on your web site,
    I really like your technique of blogging.
    I bookmarked it to my bookmark site list and will be checking back in the
    near future. Please visit my web site as well and let me know what
    you think.

  30. September 5, 2014 pukul 7:46 pm

    In fact no matter if someone doesn’t know then its up to other viewers that they will help, so
    here it happens.

  31. September 11, 2014 pukul 10:34 am

    I am really happy to glance at this website posts which contains plenty of helpful information, thanks for providing such data.

  32. September 19, 2014 pukul 8:18 am

    I constantly spent my half an hour to read this webpage’s posts
    all the time along with a cup of coffee.

  33. Januari 7, 2016 pukul 5:22 am

    Back 2 Back Chiropractic & Wellness Centeris located in Broward County, Florida behind Chase Bank in Cooper City Commons Plaza, 9469 Sheridan St.
    There is also out and about whether would be the correct individual that will
    help you together with your particular worries.
    In many cases, people find themselves unable to maintain their normal work schedule due to
    the pain that this condition causes.

  1. No trackbacks yet.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: