Search Result

Collapse
10 results in 0.0040 seconds.
Keywords
Members
Tags
for loop
  •  

  • David H
    started a topic Which of these for loops will iterate faster?
    in C

    Which of these for loops will iterate faster?

    Which one of these for loops will iterate through each character in a std::string faster?
    Code:
    for (unsigned i = 0u; i < str.length(); ++i)
    Code:
    for (unsigned i = 0u, end = str.length(); i < end; ++i)
    See more | Go to post

  • BaseballGraphs
    started a topic Chrome Bookmark Not Working

    Chrome Bookmark Not Working

    Hello,
    I've put together the following javascript that can be dragged and dropped to the favorites/bookmarks bar in Chrome (or any browser) and then when you click on it, it opens the links in the variable object:
    Code:
    javascript:(function(){ 
    var obj={"link1":"http://google.com", "link2":"http://yahoo.com"};
    for(key in obj){
    var val=obj[key];
    window.open(decodeURIComponent(val));
    ...
    See more | Go to post

  • DaAdmin
    started a topic Array not printing out beginning and end

    Array not printing out beginning and end

    This is a formula I am writing in Crystal Reports and vb is the closest thing to it so hopefully someone can figure this out.

    I am dealing with a long string that looks like 0.0055;0;0;0;0. It looks like an array but doesn;t act like on. For example, I only need the first value but if I ask for myArray[1], I get "0", myArray[2] yields ".", etc. So I created this for loop to get what I want:

    Code:
    
    
    ...
    See more | Go to post

  • How to increment a variable inside FOR loop in Stored procedure?

    Hi all,

    I have a trivial stored procedure that needs to reorder data by changing displayorder field value.

    Code:
    CREATE PROCEDURE SVC.REORDER_DIVISIONS_ALPHA
    (
     IN code VARCHAR(12),
     IN year INTEGER
    )
    LANGUAGE SQL P1:
    BEGIN
    	DECLARE counter INTEGER;
    	SET counter = 1;
    	FOR divisions AS 
    	   SELECT ID FROM SVC.DIVISIONS SV 
               WHERE   SV.LYEAR = year AND CODE
    ...
    See more | Go to post
    Last edited by Niheel; Feb 10 '11, 07:38 AM.

  • Create variable for each iteration of a for loop

    Hello, I am using a for loop to iterate through an array and need to assign each iteration to a new variable, such as

    Code:
    arr = ['bread', 'milk', 'cheese']
    for i in arr:
        print i
    but instead of printing i, I want the for lopp to assign each iteration to a unique variable, so that when the for loop completes

    Code:
    var1 = 'bread' 
    var2 = 'milk'
    var3 = 'cheese'
    ...
    See more | Go to post

  • Amiya Maitreya
    started a topic Please state the error in following program.
    in Java

    Please state the error in following program.

    Hey ! I am a Semi-pro/Amateur kind of Java Programmer. A student. I use BlueJ to write Java Programs. I was writing a Java Program to display the prime factors of a number entered. However the compiler was constantly showing error of missing return statement. Why ? and can u tell me how to cure it ?

    Code:
    public class Prime_Factorizer
    {
    public static void main(int a)
    {
    final int l = a ;
    System.out.println("Prime
    ...
    See more | Go to post
    Last edited by Stewart Ross; Sep 4 '10, 08:02 PM. Reason: e-mail address removed from post

  • johny10151981
    started a topic bash for loop

    bash for loop

    Please someone explain me

    Code:
    #!/bin/bash
    
    ARRAY=("example program" "for test only" "Lets try");
    
    ELEMENTS=${#ARRAY[@]};
    
    echo $ELEMENTS;
    
    for((i=0;i<$ELEMENTS;i++));do
    echo ${ARRAY[$i]} # echo ${ARRAY[${i}]}
    done
    I know what i will get by executing this. got this from a website.
    But I dont understand...
    See more | Go to post

  • anduril12
    started a topic For Loop error

    For Loop error

    I'm trying to create an "For Each...Next" setup where I can go through every row on a table. I need to check a specific column, and depending on that value I have a count running. It seems to work but it keeps raising a "Error 424: Object required" box.

    Any Ideas? Btw this code is being executed on a form that displays statistics.

    Code:
    For Each dr In Tables.FCG10.rows
        Select Case dr.[field]
    ...
    See more | Go to post

  • arperidot
    started a topic how to add+multiply matrices
    in C

    how to add+multiply matrices

    Develop a program which computes the current value of the vector {x}
    based on the following forward iteration:

    {x}(n+1) = [K] {x}(n)+ {z}, n = 0,1,2,3,4.

    In other words, the next vector {x} is equal to the product of [K] and
    the current vector {x} + constant vector {z}.

    Perform the matrix multiplication by using the function:

    void matrix_mult(dou ble a[3][3], double *b, double *c, int...
    See more | Go to post

  • Iterator not changing when used in SQL Statement

    I have the following code, which is going through a FOR loop to run an INSERT statement with a nested SELECT statement. The issue is that I am trying to use the interator in the SQL statement, but the number never changes, even though the process is running through the proper number of times. What am I missing? Why is the number not appearing to be changing?

    Code:
     Sub SetLEAs()
        Dim MyCnt As Integer
        Dim i As Integer
    ...
    See more | Go to post
Working...