In Java, exiting multiple loops lets you exit by using the control of the outer loop to receive the inner loop control. Here use the label to exit the loop. Here's a demo:
public class Test
{public
static void Main (string[] args)
{
int array[][] = {1, 2, 5,},{4, 5, 6},{3 , 2, 5}};
mark:for (int i = 0; i
The following are the output results:1I am the outer loop!2I am the outer loop!5Found Number 5! Break from inner loop!I am the next code of
-stop. In summary, using a while to iterate over a cursor is the most complex method.
Third: For loops for V_pos in C1 loop v_name:= v_pos.ename; V_job:= V_pos.ejob; . end Loop; A For loop is a relatively simple and practical method. First, it will automatically open and close cursors. Resolves the annoyance of your forgetting to turn on or off the cursor. Other, automatically defines a record type and declares the variable of that type, and automatic
Nested cursor loops Create or replace procedure xh_number_186_diff_p is begin declare nbsp in Oracle stored procedures ; -Query out a set www.2cto.com CURSOR c_number is SELECT Numbe r186, money186 from xh_number_186_t a where a.number186 In (select n.number186 nbsp from xh_number_186_t n NB Sp minus select t.service_id NBSP ; from Xh_codesource t NBSP ; nbsp WHERE t.
The example in this article describes how jquery loops through subnodes and gets values. Share to everyone for your reference, specific as follows:
HTML code section:
JS Code section:
var Arrul = JQuery (". Left_tree_ad_btn_container > ul");
Jquery.each (Arrul, function () {
alert (jQuery). FIND ("img"). attr ("src"));
Alert (JQuery (this). Find ("Li"). attr ("class"));
More interested readers of jquery-related content
The example in this article describes how Python loops over remote ports. Share to everyone for your reference. Specifically as follows:
In Ip.txt, one IP address and port number per line, the code can loop through the specified port for these IP addresses.
#!/usr/bin/env python
#-*-CODING:GBK-*-
Import socket,time while
1:
file_obj = open (' Ip.txt ')
For line in File_obj:
try:
sc=socket.socket (Socket.af_inet,socket. SOCK_STRE
check.bat this batch. It uses a For loop, reads the filename from the list.txt, replaces the variable, and writes it to the Check.bat. The most common use of this is echo. In operations that contain output redirection, including for loops, because the content written to the Check.bat contains an operation to write to the Check.log, a double quotation mark is used to mask one of the output redirection operations. Here is a problem: the command written
command from a file as follows:
[jerry]$ echo "P" > Commands.txt
[jerry]$ sed-n-F commands quote.txt
Executing the above code, you will get the following result:
There is only one thing that makes a dream impossible to achieve:the fear of failure.
-Paulo Coelho, the Alchemist
Like other programming languages, SED also provides a loop and branching tool to program the execution flow. This tutorial explores how to use the loops and branches o
Create or replace procedure Sp_addprojectqj (RET out number,Flowid in number--process ID)AsCursor C_design isSELECT * from lc_vr_detail where lc_crm_visitreport_id = Flowid and Dd_status! = 2;C_row C_design%rowtype;V_ID number;BeginFor C_row in C_design loopPnextid (' T_xmsjqj ', v_id);--Items related to device (ID, project name, device) values--design Schedule (v_id, project name, device name)Insert into T_XMSJQJ (ID,F2,SJ,FQJ,F3,CJ,FSL,FBZ,FQZJE,FLDKNX,FLDJZ,FCYYY,FDOCNUM,FGDYY,F6,BZ)VALUES (V
CREATE PROCEDURE' db '. ' Test_procedure ' ()BEGIN--you need to define variables that receive cursor data DECLAREACHAR( -); --Cursors DECLARECurCURSOR for SELECTI fromdb.t; -- End Flag DECLAREDoneINT DEFAULTFALSE; --binding the end flag to a cursor DECLARE CONTINUEHANDLER for notFOUNDSETDone=TRUE; --Open Cursor OPENcur; --Start LoopRead_loop:loop--extract the data in the cursor, there is only one, many words are the same; FETCHCur intoA; --at the end of the statement IFDone ThenLEAV
, lower) loop executed statement; end loop; declare I begin for i in 1. 50 Loop Dbms_output.put_line (i); end loop; end; ======= Cursor =======************* --Cursors: Is the system to open a data buffer for our users! The results of the SQL statement execution are stored!--Each cursor area has a name, and the user gets the record one line at a cursor!--01. Implicit cursors are created automatically when executing SQL statements in our PL/SQL statement! ====>sql--02.
produced by the previous join operation (and only the columns of interest), and the incremental join Some data rows in buffer refer to the same row of data stored in the previous join buffer (match success); The incremental join buffer guarantees the small frequency of the copy data from the previous join buffer, which saves space in the join buffer, because in general, the rows produced by the previous join operation may be matched by the multiline data of the joined table of the join operatio
Tags: traversing character parameter CTS array let span self-increment + =Enter parameter traversal########## [email protected] indicates a parameter string#!/bin/bashecho [email protected]For i in [email protected]; DoEcho $iDoneSelf-incrementAs far as I know, in bash, there are currently five ways to do this:1. i= ' expr $i + 1 ';2. Let i+=1;3. ((i++));4. i=$[$i +1];5. i=$ (($i + 1))Array (traversal)Cd/d//brmy_prj_dir=$ (CD.. /.. ; PwdMy_projects= (RunkRunk_ccRackC00)For i in ${my_projects[@]}
CREATE PROCEDURE' test '. ' New_procedure ' ()BEGINDECLAREDoneINT DEFAULTFALSE; --you need to define variables that receive cursor data DECLAREACHAR( -); --Cursors DECLARECurCURSOR for SELECTI fromtest.t; --Traverse data End Flag DECLAREDoneINT DEFAULTFALSE; --binding the end flag to a cursor DECLARE CONTINUEHANDLER for notFOUNDSETDone=TRUE; --Open Cursor OPENCur1; --Start LoopRead_loop:loop--extract the data in the cursor, there is only one, many words are the same; FETCHCur intoA; --
and Leetcode 207. Course Schedule (Topological ordering-finding the presence of loops in a graph) is similar.Notice that the parallel or self-loops that may appear in the input are p:prerequistites in the for (auto).Code:Class solution {public:vector Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. Leetcode 210. Course Schedule II (topological seque
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.