Q&A

  • For문에서...
For문을 돌리면.. 디폴트로 1씩 증가를 하잖아요... 반대는 Downto를 쓰면 되고...

근데.. 문제는.. 1씩이 아니라 2나 3... 내가 주고 싶은대로 줄수는 없나용...???

답변부탁드릴께용...

오늘도 모두들 수고하셔용~~~~~~ ^^
1  COMMENTS
  • Profile
    [勳]후니 2004.04.23 04:07
    help 에서 찾아보시면 근방인데..

    도움말을 참조를 잘하세요..

    A for statement, unlike a repeat or while statement, requires you to specify explicitly the number of iterations you want the loop to go through. The syntax of a for statement is

    for counter := initialValue to finalValue do statement

    or

    for counter := initialValue downto finalValue do statement

    where

    counter is a local variable (declared in the block containing the for statement) of ordinal type, without any qualifiers.
            initialValue and finalValue are expressions that are assignment-compatible with counter.
            statement is a simple or structured statement that does not change the value of counter.

    The for statement assigns the value of initialValue to counter, then executes statement repeatedly, incrementing or decrementing counter after each iteration. (The for...to syntax increments counter, while the for...downto syntax decrements it.) When counter returns the same value as finalValue, statement is executed once more and the for statement terminates. In other words, statement is executed once for every value in the range from initialValue to finalValue. If initialValue is equal to finalValue, statement is executed exactly once. If initialValue is greater than finalValue in a for...to statement, or less than finalValue in a for...downto statement, then statement is never executed. After the for statement terminates (provided this was not forced by a break or an exit procedure), the value of counter is undefined.

    For purposes of controlling execution of the loop, the expressions initialValue and finalValue are evaluated only once, before the loop begins. Hence the for...to statement is almost, but not quite, equivalent to this while construction:

    begin
            counter := initialValue;
              while counter <= finalValue do
              begin
            statement;
            counter := Succ(counter);
              end;
            end

    The difference between this construction and the for...to statement is that the while loop reevaluates finalValue before each iteration. This can result in noticeably slower performance if finalValue is a complex expression, and it also means that changes to the value of finalValue within statement can affect execution of the loop.

    Examples of for statements:

    for I := 2 to 63 do
      if Data[I] > Max then
        Max := Data[I];
    for I := ListBox1.Items.Count - 1 downto 0 do
      ListBox1.Items[I] := UpperCase(ListBox1.Items[I]);
    for I := 1 to 10 do
      for J := 1 to 10 do
      begin
        X := 0;
        for K := 1 to 10 do
          X := X + Mat1[I, K] * Mat2[K, J];
        Mat[I, J] := X;
      end;

    for C := Red to Blue do Check(C);


    • 이승근
    • 2004.04.23 06:07
    • 0 COMMENTS
    • /
    • 0 LIKES
    • 손상엽
    • 2004.04.23 03:45
    • 1 COMMENTS
    • /
    • 14 LIKES
    • [勳]후니
      2004.04.23 04:07
      help 에서 찾아보시면 근방인데.. 도움말을 참조를 잘하세요.. A for statement, unlike a repeat or...
    • 배준영
    • 2004.04.23 03:14
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 이중철
      2004.04.23 19:13
      TChart 일경우 첫번째 방법 건수는 좌측을 Y축으로 사용하고 금액은 우측을 Y축으로 사용하면 됩니다. ...
    • 최용일
      2004.04.23 03:32
      안녕하세요. 최용일입니다. 흠... 하실려고 하는 일의 종류에 따라서 여러가지 방법이 있습니다. 텍...
    • 권영길
      2004.04.23 03:44
      파일사이즈가 커서 다 읽어들이는게 부담된다면 offset위치와 읽을 Length를 알경우 파일스트림으로 오픈...
    • 박수영
    • 2004.04.23 00:08
    • 1 COMMENTS
    • /
    • 0 LIKES
    • Crazy
      2004.04.23 01:07
      DBGrid1.DataSource.DataSet.RecNo;
    • ^ㅡ^
    • 2004.04.22 22:28
    • 4 COMMENTS
    • /
    • 0 LIKES
    • 한원희
      2004.04.22 23:22
      안녕하세요. 한원희입니다. 오라클에 대한 연결 정보를 생성할 때 OLE DB 공급자에서 “Microsoft OLE DB...
    • ^ㅡ^
      2004.04.22 23:35
      님 답변 잘 들었습니다. 넘 감사 드리구요 Provider=OraOLEDB.Oracle.1;Password=wmsuser;Persist Secu...
    • Crazy
      2004.04.23 01:11
      안녕하세요. 에러메시지 내용은 Database가 어디있는지 설정을 잡아주어야한다는 것입니다. Net Configur...
    • 김진석
      2010.11.19 09:51
      오라클의 설치경로가 c:\oracle이 아닌경우가 대부분이네요 저도 지금 6시간 고생하다 발견했습니다. ...
    • 포 맷
    • 2004.04.22 20:33
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 박수영
      2004.04.22 21:38
      alt + shift + 방향키...
    • 김동열
      2004.04.23 00:11
      에러 수정.
    • 박희경
    • 2004.04.22 15:12
    • 0 COMMENTS
    • /
    • 0 LIKES
    • 최인권
    • 2004.04.22 10:40
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 최용일
      2004.04.22 11:11
      안녕하세요.최용일입니다. 1번은... 책을 좀 보시는것이 좋을것 같네요... far는 16비트시절의 잔재이...
    • 맑은물
    • 2004.04.22 10:04
    • 0 COMMENTS
    • /
    • 0 LIKES
    • Galaxy
    • 2004.04.22 06:27
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 장덕곤
      2004.04.22 09:54
      FieldsByName 이 아니구요.. FieldByName 입니다...
    • 델촙
    • 2004.04.22 05:10
    • 3 COMMENTS
    • /
    • 0 LIKES
    • 박수영
      2004.04.22 17:44
      이벤트중에 onMouseDown 이란 곳에서 코딩하시면 됩니다...
    • 델촙
      2004.04.22 21:30
      폼에서 클릭여부가 아니라 윈도우상에서 클릭여부를 알고 싶습니다요 ㅠ.ㅠ
    • 최용일
      2004.04.22 22:25
      안녕하세요. 최용일입니다. 흠... 후킹을 하셔야 겠네요... 델코(www.delphikorea.com)의 민성기님이...
    • 김건림
    • 2004.04.22 04:00
    • 4 COMMENTS
    • /
    • 0 LIKES
    • 최용일
      2004.04.22 10:48
      안녕하세요. 최용일입니다. P2P방식이 아닌 C/S방식이라면 클라이언트는 유동이든 사설이든 아무런 문제...
    • 김건림
      2004.04.22 18:56
      답변 달아 주셔서 정말 감사드려요~ A라는 사람과 B라는 사람이 있다고 치면, A라는 사람이 B라는 사람...
    • 최용일
      2004.04.22 19:13
      안녕하세요. 최용일입니다. 위에서 말씀드렸지만 B에서 서버로 로그인을 하여 연결이 성공적으로 이루여...
    • 김건림
      2004.04.22 19:14
    • 박동성
    • 2004.04.22 02:26
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 너구리
      2004.04.22 02:38
      그럼 데이타소스를 끊어 버리십시오.. 아니면 어쩌구disabled 이런 프로시져 도 있었던거 같은데요.. ...
    • 델짱
    • 2004.04.22 01:39
    • 3 COMMENTS
    • /
    • 0 LIKES
    • [勳]후니
      2004.04.22 02:23
      시시템 부화를 무진장 걸어놓구서.. 그레이드에서 그런 경우가 나온적이 있습니다. 바이러스때문에 ...
    • 델짱
      2004.04.22 18:14
      답변감사 드립니다. 혹시 그 문제를 해결 하셨습니까?? 해결 하셨다면 어떤 방법으로 하셨는지 궁금...
    • [勳]후니
      2004.04.22 19:04
      그땐 백신 검색중였고, 특별하게 어떤 조치를 치해서 했던건 아니고요... 원도우 다시 설치하고서 해결 ...