Is it because Pascal was designed to be so, or are there any tradeoffs?
Or what are the pros and cons to forbid or not forbid modification of the counter inside a for-block? IMHO, there is little use to modify the counter inside a for-block.
EDIT:
Could you provide one example where we need to modify the counter inside the for-block?
...
Hi folk,
This is one of those requirements that seem to get more complicated, every time I find a Windows/cmd shell hack that need a 'work around'. Essentially ... I need to iterate through a specific list of folders in a DOS Shell FOR loop. Here is the loop I came up with:
echo ^ [start for test]
for /F "usebackq " %%f IN (`dir...
num = list(str(1234567))
for n1 in num:
print n1
for n2 in reversed(num):
print '\t', n2
On each iteration, it prints the first digit from the first loop and all 7 from the reverse loop. How can I print not all digits but only the last (i.e first) digit from reverse loop?
Thanks
...
I'm using the Google Maps API to plot several points on a map. However, in the click event function below, i is always set to 4, i.e. its value after iterating the loop:
// note these are actual addresses in the real page
var addresses = new Array( "addr 1", "addr 2", "addr 3", "addr 4" );
for (var i = 0; i < addresses.length; i++) {
...
Is there a faster way? I basically need to add AA-ZZ to thousands of records at a time.
Just a list of 35 items takes quite a while to complete muchless a list of a thousand.
procedure Tmainform.btnSeederClick(Sender: TObject);
var
ch,ch2:char;
i:integer;
slist1, slist2:TStrings;
begin
slist1:= TStringList.Create;
slist2:...
I use jQuery 1.4 for AJAX, MVC on the server side. Everything works fast on the local computer.
Tables with data are compiled and sent as HTML documents (I’m testing the system with large tables, over 100KB). When I download the same page through the internet, everything works 5-10 times slower or is simply pending.
I checked Forefox...
Possible Duplicate:
LOOP in JAVA ???
Hi everyone
I have this file :
CREATE MRED:NAME=MRED:0,MICR=0-0,CRC=TRUE,CODE=HDB3,NUA=FALSE,BER=E10_3,BAF=0,LREDUNEQ=SIMPLEXB,L1CTS=<NULL>,LOWBER=E10_6,REMAL=<NULL>,WMOD=SINGLE_TRUNK;
CREATE MRED:NAME=MRED:1,MICR=0-1,CRC=TRUE,CODE=HDB3,NUA=FALSE,BER=E10_3,BAF=0,LREDUNEQ=SIMPLEXA,L1CTS=<NULL...
I was hoping for a way that I could save on code by creating a loop for a few lines of code. Let me explain a little, with-out loop:
icon1.button.iconLoad.load(new URLRequest("icons/icon1.jpg"));
icon2.button.iconLoad.load(new URLRequest("icons/icon2.jpg"));
icon3.button.iconLoad.load(new URLRequest("icons/icon3.jpg"));
icon4.button.ico...
I have the following code to display JSON results from an AJAX request as an unordered list. It works well enough in Safari but on Mobile Safari on the iPhone the raw data displays but the UL does not. In fact the for loop isn't triggered.
$("#results").append(data);
var songdata = JSON.parse(data);
var i = 0;
for (i=0;i<=songdata.to...
The following Javascript displays in Safari but not Mobile Safari. Can anyone see any bugs?
$("#results").append(data);
var songdata = JSON.parse(data);
var i = 0;
for (i=0;i<=songdata.total;i++)
{
alert(i);
var songhtml = "<ul><li><img src=\"" + songdata.data[i].artwork + "\" /></li><li>" + songdata.data[i].title + "</li><li...
using Mozilla jetpack , when i do the following code .. i get that linking is undefined !!! why ? or how to fix it ?
var links = doc.querySelectorAll('#courses_menu > ul > li > a');
var linkz=links[1].href.split("?");
var i = 0;
for (i=0;i<=4;i++)
{
var linking= links[i];
}
jetpack.notifications.show(" "+ linking);
...
Hello,
I have created 2 module for joomla. When I enable any one its working fine with joomla in left and right. But when I enable both the website is not working...its not display any website content.
Please help me how I can enable more then 2 module.
Thanks,
Manoj Singhal
...
I have a list of websites in a string and I was doing a for loop to add "http" in the front if the first index is not "h" but when I return it, the list did not change.
n is my list of websites
h is "http"
for p in n:
if p[0]!="h":
p= h+ p
else:
continue
return n
when i return the list, it returns my original...
I'm using Visual Basic 2008EE and I have a problem with this loop:
If x = CType("new", Primitive) Then
TextWindow.Write("How many new users would you like to add? ")
k = TextWindow.ReadNumber()
For mt = 1 To k
NewUserEntry()
Next
and i get this error:
"type of 'mt' is ambigious because ...
The following function is supposed to execute during the "onload" event of my webpage.
function setUpTranslation() {
var phrases = document.getElementsByTagName("p");
for (i = 0; i<phrases.length; i++) {
phrases[i].number = i;
phrases[i].childNodes[1].innerHTML = french[i];
phrases[i].childNodes[1].onMouseDown ...
Convert to python:
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
for (int i = 0, j = i + 3; i < 100; ++i, j= i+3)
cout << i << " j: " << j << endl;
getchar();
return 0;
}
I try:
for i in range(99):
j = i + 3
print i, " j: ", j
How to make it one for loop?
...
How do i reference the dll file from the qt project. can someone give me the sample .pro file?
Thx.
...
Insomuch as I understand "for(;;)" has no initial condition, no test condition and no increment condition, and therefore loops forever, I am curious why the test condition succeeds each loop.
Does the empty expression ";" evaluate as true in C? Or is this a special case handled by compilers?
A similar, but unrelated question.
...
I am making a Java program to calculate Simpson's rule for integrals. Here is the code I have. Notice the second column of numbers in the output values of count == 4,9,10,11. They are not numbers that I need, they do not follow the pattern. I need these numbers to be accurate. What is going on and how can I fix it?
public static void ma...
I'm creating some code that will find a space between characters, and use the characters before the space and the ones after it. These characters are stored in a NSString. Here is what I have so far, however, it's not seeing the empty character.
NSString *tempTitle = self.title;
unsigned int indexOfSpace; // Holds the index of the c...