Jump to content


Photo

Terceira Parte De Loops


  • Faça o login para participar
8 replies to this topic

#1 Without a Nick

Without a Nick

    Sem culpa no cartório

  • Usuários
  • 2378 posts
  • Sexo:Não informado
  • Localidade:Guarulhos

Posted 26/03/2004, 17:17

Terminando a minha série de tutoriais sobre loops, apresento-lhes o loop DO, o menos utilizado na internet.

Dentre 100 sites que usam loops, pode-se contar que 10 usam também o loop DO, que não são muito usados, pois algumas vezes pode confundir a cabeça do programador a toa.

Mas como gosto de alguma coisa completa, logo, olhe um exemplo:

<script language="javascript">
<!--
i=1;
do {
  document.write("Linha<br>");
  i++;
}
while(i<=5)
//-->
</script>

Isso fará com que cinco linhas sejam feitas, com o escrito Linha em cada uma delas, mais a tag <br>, responsável pela quebra de linha.

Passos:

Primeiro definimos uma variável (i), com o valor 1.
Logo abaixo, executamos o comando do, abrindo um bloco {}. Lá, você digita o comando que você quer que seja executado e depois que terminar, você coloca o executor, o qual coloquei i++, o qual mostrará um em um.

Feche o bloco.
Execute o loop while, mas apenas com a condição (i<=5)

Pronto! Você criou um loop DO.

Um exemplo mais complexo.

<script language="javascript">
<!--
function expoente(i) {
var formula=Math.pow(2,i);
return formula;
}
//-->
</script>
<script language="javascript">
<!--
document.write("<table border=0 width=99%><tr width=33%><th>Número</th><th>Expoente</th><th>Resultado</th></tr>");
i=0;
do {
  document.write("<tr width=33%>");
  document.write("<td>"+i+"</td>");
  document.write("<td>2</td>");
  document.write("<td>"+expoente(i)+"</td>");
  document.write("</tr>");
  i++;
}
while(i<=50)
document.write("</table>");
//-->
</script>

Esse exemplo eu já usei na minha coluna, mas não com o loop DO, e sim apenas com os loops FOR e WHILE.

Ele mostrará umas informações sobre um número que será gerado a partir de um loop DO, e que depois, com a execução do script expoente(), iremos obter o número, de base 2, elevado a um número (i).

Encare isso como uma equação.

E com um valor estipulado, temos diversas soluções para essa equação.

Caso esteja em dúvida sobre isso, por favor, me avise, postando aqui um tópico.


E o script estará em anexo.

Attached Files

  • Attached File  do.html   546bytes   21 downloads


#2 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 08/10/2017, 00:28

Cialis Generika Auf Rezept cialis Buy Zithromax Online In Usa
Viagra Generika Erfahrungsbericht levitra expre delivery Allergie Lioresal Intrathecal
Firstmedicine On Line Pharmacy Store Buy Now Doxycycline Doxycycline Venta Online buy viagra online Zithromax Heart

#3 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 10/10/2017, 22:37

Levitra Prezzo Farmacia Italia Acquistare Viagra Online Con Postepay Viagra Overseas generic viagra Prospecto Propecia Viagra Cialis Prezzi Which Online Pharmacies Accept Paypal
Bilan Clomid Keflex Generic Brand viagra Buy Female Viagra Online Viagra 100 Mg Comprime Purchase Finasteride Without Rx
Cephalexin 500 Mg And Alcohol Propecia Mb Coconut viagra online pharmacy Cephalexin Open Capsule Sprinkle Kamagra Deutschland Forum
Dapoxetina Porto Alegre Propecia Ot Minoxidil pharmacy prices for levitra Achat Kamagra Belgique Trouver Levitra Sans Ordonnance Cialis Online Rezeptfrei Kaufen

#4 HaroNism

HaroNism

    Super Veterano

  • Usuários
  • 13822 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 12/10/2017, 10:20

Amoxicillin Dose During Pregnancy generic viagra Viagra Senza Ricetta Cialis GРÑСÂnstig Kaufen
Cialis Para Hombres viagra cialis Cialis Kamagra Sildenafil Does Cialis Work

#5 sapedlok

sapedlok

    24 Horas

  • Usuários
  • 420 posts
  • Sexo:Masculino
  • Localidade:Veley Stream

Posted 14/10/2017, 01:18

Discounts! top 2017 products progect11.jpg Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked! If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included). buy.png READ MORE XIAOMI Mi Drone 1080P WIFI FPV Quadcopter-588.73 $JiYo JY — 508G 2.4G 4CH Pock Ball for Water Sand Ground Playing-17.94 $Bags handbags women famous brands shoulder bag female bags women handbag women bolsa feminina bolsos mujer de marca famosa 2016 ( 21.80 $)All Star Hi Neon Crimson Canvas Sneaker ( 49.50 $)Sexy bikini 2016 classic shell bikinis set tankini beachwear monokini swimwear women swimsuit push up swim suit biquini bj266 ( 18.80 $)Womens Black Perforated Italian Leather Driving Gloves ( 98.00 $)Simplee flower embroidery jeans female light blue casual pants capris 2016 autumn winter pockets straight jeans ( 44.98 $)Baby Girl Sterling Charm Bracelet ( 105.00 $)Tickets, hotels, train tickets. Ordering, booking the ticket. Buy train tickets and air tickets online. Booking of hotels.Aukey 2 usb charger travel fast charging with quick charge 3.0 for samsung galaxy s7s6edge, lg g5 iphone ipad, nexus 6p & more ( 24.80 $)Contact's genuine crazy horse cowhide leather men wallets fashion purse with card holder vintage long wallet clutch wrist bag ( 42.50 $)Retro pointed toe and lace-up design men's formal shoes ( 37.68 $)Original 2016 brand winter warm down jacket plus size manteau femme women slim elegant asymmetric long fur collar hooded parka ( 117.05 $)CONTACT'S Genuine Crazy Horse Cowhide Leather Men Wallets Fashion Purse With Card Holder Vintage Long Wallet Clutch Wrist Bag ( 42.50 $)HX OUTDOORS D - 123 Tactical Fixed Edge Knife-18.47 $ 59.jpg
Discounts! great buy makeup

progect11.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
GearBest: online shop for the best electronics, toys, outdoor, clothing and much more
Brazilian virgin hair closure queen hair products brazilian virgin hair straight closure human hair lace closure ( 24.24 $)
Gruv gear duostrap bass guitar double-shoulder suspenders strap leather guitar strap ( 119.08 $)
Inleela 2016 new arrival autumn bag large size women shoulder bag daily vintage women messenger bag causal rivet bag ( 29.00 $)
A World of Ice and Fire Game of Thrones
Rodina (teleserial, 2015)
McAfee Stinger skachat besplatno McAfee Stinger 12.1.0.2302
Color block pocket design turn-down collar long sleeve men's shirt ( 18.44 $)
Skinny White Leather Belt ( 132.00 $)
100Pcs Colorful Rainbow Paper Cake Cupcake Liner Baking Muffin Box Cup Case Party Tray Cake Mold Decorating Tools Cupcake paper ( 0.99 $)
Accounting services wisely the Back office for business Button
2016 new fashion hot fashion exquisite alloy love letters friendship ring women simple cute cool rings ( 0.99 $)
Online shop chandeliers and lamps in Moscow and Saint-Petersburg (SPb). Buy chandelier on Voltoff.ru - Voltoff.ru
Razvitie nauki, naukoyomkih proizvodstv, a takzhe…
Drone jjrc h8d 2.4ghz headless mode 5.8g fpv rc quadcopter with 2mp camera updated jjrc h8c 300m distance vs h12c ( 112.42 $)


103bb.png
Discounts! best beauty buys

progect11.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
Multicolor leather and suede lace-up bootie ( 387.83 $) Jil Sander
CoolChange Polarized Cycling Glasses Bike Outdoor Sports Bicycle Sunglasses Goggles 5 Groups of Lenses Eyewear Myopia Frame ( 26.65 $)
ON THE ROAD Battery Holder 18650 to 26650 ( $1.47 )
Satin Cami and Shorts Set Lace Nightgowns Comfy Pajamas Pretty Nighties Artificial Silk Sleepwear Sets ( 16.00 $)
Car Perfume Clips Seat Liquid Air Freshener For Car Auto Kit Auto Interior Accessories Decoration Car Logo Free Shipping ( 4.28 $)
10 x Original Xiaomi Zi5 Rainbow AA Alkaline Battery-6.27 $
Malaysian virgin hair loose wave 7a unprocessed virgin hair malaysian virgin hair 4 bundles malaysian loose wave 100% human hair ( 53.60 $)
Fashion Women Handbag Solid Patchwork Lady Day Clutches New Fashion Soft Girl Zipper Packet Fashion Female Casual Bags women bag ( 8.20 $)
Underwear women sexy panties lace transparent womens briefs panty women seamless panties lingerie intimates plus size ( 3.98 $)
Automaticky of high quality Alcantara Premium class and covers for car cushion seat covers for cars
Izgoj (film, 2000)
Laminated python silver sandal wcrystals ( 722.18 $) Roberto Cavalli
Gadget Softy Fabric and Leather Cosmetic Clutch ( 60.00 $)
V Parizhe nachinaetsya sud nad terroristom Karlosom Shakalom
Rossen, Robert


137bb.jpg
Discounts! racosme product review progect11.jpg Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked! If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included). buy.png READ MORE Green Clip-On Drop Earrings ( 148.00 $)V Rossii nachalas akciya "Vam, lyubimie"Bluboo Picasso 3G Smartphone-95.34 $10000mah travel portable waterproof solar power bank 2 usb external solar panel charging dual led light compass for all phone ( 16.87 $)Fashion hooded letters star stripes print men's long sleeves hoodie ( 14.85 $)Mens Mop Tatoo Oval Cufflinks ( 79.80 $)Windows Firewall Control 4.9.4.06Pcs Castle Building Model ( $0.94 )New yaki african american full synthetic hair wigs best glueless kinky straight high temperature wire women wig for black women ( 22.88 $)Herobiker bicycle protector warmer boot cover outdoor sports wear bike cycling shoe toe cover black 1 ( 8.99 $)Women's simple high waist plaid pocket skirt ( 22.63 $)stainless steel necklace men,chain 3mm wide(40-65cm),customized jewelry curb cuban hiphop,wholesale necklaces accessories VN001 ( 1.98 $)KlyutWaterproof Aluminum Business ID Credit Card Mini Wallet Holder Pocket Case Box Hot Selling ( 3.72 $)Maikes High Quality Soft Sweatband Genuine Leather Watch Strap stainless Steel Buckle 12 14 16 18 19 20 21 22mm Thin Watch Band ( 7.99 $) 132.jpg

#6 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 15/10/2017, 19:17

Vipps Canadian Pharmacy Reviews Cytotec Comprar Olanzapine For Sale Next Day Delivery viagra Precio De Cialis Con Receta Buy Online Viagra Pfizer From Pakistan

#7 zapedlok

zapedlok

    Expert

  • Usuários
  • 554 posts
  • Sexo:Feminino
  • Localidade:Waimea

Posted 17/10/2017, 03:07

Discounts! hair cream progect12.jpg Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked! If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included). buy.png READ MORE LUOM G50 Programmable 10 Button Professional Mechanical Gaming Mouse-23.77 $NO.1 D5+ Smartwatch Phone ( 119.01 $)1 PCS Waterproof tattoo flash Temporary 3d Tattoo sticker on body dreamcatcher dream catcher tattoo fake glitter tattoo ( 0.69 $)Sports Arm Band for iPhone 6 4.7 inch ( $2.39 )Good quality leather mini women messenger bag circle crossbody bags cat ear shoulder bag famous brand ( 8.00 $)7a brazilian deep curly virgin hair rosa hair products brazilian deep wave 4 bundles brazilian hair weave bundles human hair ( 53.70 $)Original XiaoMi Bluetooth V4.0 Mi Smart Weight Scale by 4 x AA Battery ( 41.99 $)Black Neoprene Slip On Womens Skaters ( 122.00 $)One piece simple style bicolourable alloy men's ring ( 2.88 $)E05 DLP Pocket Projector 854 x 480 Pixels 1500 Lumens-182.85 $Black Satin Pouch ( 178.00 $)Rejgal Game of ThronesOriginal Eleaf iStick Pico TC 75W Mod Kit ( 31.76 $)15ml White Peel Off Liquid Nail Art Tape Latex Tape Palisade For Easy Clean Base Gel Coat ( 2.00 $)Kstati o pogode 05.05.2017 Glavnij prazdnik prevrashaetsya v shou (Video) 40bb.jpg
Discounts! hair product reviews

progect12.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
Nomu s10 mobile phone 5 inch quad core 2gb+16gb mtk6737t smartphone 5000mah quick charge 13.0mp 1280x720 ip68 waterproof phone ( 129.99 $)
Large capacity man travel bag outdoor mountaineering backpack men bags hiking camping canvas bucket shoulder bag 012 ( 35.98 $)
1 PCS cartoon Icon Free Shipping Kawaii Icons Harajuku Acrylic Pin Badge Backpack Decoration Badges ( 0.70 $)
Brazilian virgin hair with closure 3 bundles brazilian straight hair with closure human hair with closure brazilian virgin hair ( 20.00 $)
Twdvs baby hair bands hairband rhinestone ribbon pearl diamond baby girls flowers headband kids hair accessories ( 1.65 $)
U80 Smart Bluetooth Watch Call Message Reminder Sleep Monitor-8.35 $
Iwish brazilian virgin hair body wave 4pcs wavy virgin brazilian hair brazilian body wave human hair brazilian hair weave bundle ( 50.99 $)
Internet-shop of clothes and shoes Occasion.ru: women's and men's clothing, shoes and accessories
Digital USB Power Charger Voltage Current Tester ( $3.42 )
«Ne travi mne dushu, ne travi…»
Bronze Ring wSkeleton Flat Hand ( 115.50 $)
2pcs baofeng uv-5r walkie talkie vhfuhf136-174mhz&400-520mhz dual band two way radio baofeng uv 5r portable walkie talkie uv5r ( 69.99 $)
CUBOT V1 Sleep Monitoring Smart Band IP65 Waterproof-14.50 $
Leisure watermelon print and weaving design women's shoulder bag ( 11.03 $)
Official online store "PaperShop"


27bb.jpg

#8 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 22/10/2017, 05:41

Online Pharmacy Uk Viagra viagra 585 Cipa Canadian Approved Pharmacies Viagra Wirkung Essen Propecia Y Dutasteride
Dutasteride Where To Buy No Doctor Quick Shipping Finasteride Prescription Floroda generic cialis п»Ñ0 5 Propecia Finasteride Acheter Du Xenical En Ligne Differenze Cialis Viagra
2.5 Mg Cialis Generic viagra online pharmacy Injectable Amoxicillin Manufacturers Buy Provera

#9 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 22/10/2017, 07:04

Pharmacie En Ligne Du Canada Cialis Quando Il Viagra Non Basta Propecia Hk viagra online prescription Clomid Produit Qualityrx Acquista Viagra Senza Ricetta
Achat Propecia cialis Online Pharmacy Propecia Cheap Tadalafil Viagra Brand Vs Generic
Vendita Cialis Ebay buy viagra online Buy Proplanalol Online Uk
Clomid Amenorrhee Ajanta Pharma Kamagra Dragon Power generic levitra l tabs Extra Dose Of Amoxicillin Clavulanic Rosa Impex Pvt Ltd Viagra Zithromax Sinusitis Dosage
Buy Viarga Without A Percription Amoxicillin And Tanning Clobetasol 30g With Free Shipping why is levitra so expensive Adderall Online Pharmacy
Comprar Cialis Barato viagra online prescription Valuepharmaceuticals Viagra Online Blue Cheapeast Acticin In Australia




0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq