사이드바 영역으로 건너뛰기

게시물에서 찾기분류 전체보기

21개의 게시물을 찾았습니다.

  1. 2009/06/24
    yes no 선택할 수 있는 메시지 창
    단단이아빠
  2. 2009/05/03
    프로그램 중복 실행 방지
    단단이아빠
  3. 2009/04/17
    문자열
    단단이아빠
  4. 2009/04/02
    델파이 수학 함수 정리
    단단이아빠
  5. 2009/03/30
    [펌]쉽게 따라 하는 콤보박스 Object 삽입방법(1년미만 초보분만보세요)
    단단이아빠
  6. 2009/02/13
    dateutils.pas
    단단이아빠
  7. 2007/10/25
    Delphi 연합세미나를 다녀와서..
    단단이아빠
  8. 2007/08/12
    Delphi 2007 에서 zeos 컴포넌트 사용하기(1)
    단단이아빠
  9. 2007/07/12
    [펌]스트링 그리드에 포커스 넣기...
    단단이아빠
  10. 2007/07/12
    TMS TAdvStringGrid
    단단이아빠

yes no 선택할 수 있는 메시지 창

  If MessageDlg(SI0002, mtInformation, [mbYes, mbNo], 0) = mrYes then

 

진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

프로그램 중복 실행 방지

퍼온곳 : 델마당

URL : http://www.delmadang.com/community/bbs_view.asp?bbsNo=17&bbsCat=0&st=C&keyword=%uD504%uB85C%uADF8%uB7A8%20%uB450%uBC88&indx=404206&keyword1=프로그램&keyword2=두번&page=1

 

프로젝트에서 view source 하셔서
-----------------------------------
var
  mHandle : THandle;
begin
  Application.Initialize;
  mHandle := CreateMutex(nil, True, PChar('noDuplicate'));

  if GetLastError = ERROR_ALREADY_EXISTS then begin
    MessageBox(0, PChar('프로그램이 이미 실행중입니다.'), '중복실행', MB_OK or MB_ICONINFORMATION);
    halt;
  end;
------------------------------------------------
추가해보세요.

 

uses 에 Windows 를 추가해야 한다.

진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

문자열

ExtractStrings

     

     메모장 텍스트를 StringList에 넣고

갯수만큼 루프 돌면서

ExtractStrings([';'],[],pchar(s), slTmp);

하시면 slTmp 에 나눠져서 들어갑니다.

slTmp.Strings[0] 은 Home
slTmp.Strings[1] 은 0
slTmp.Strings[2] 은 2_10_1559
...
순서로 들어갑니다...

s 는 Home;0;2_10_1559;http://192.168.16.190/banner.PNG 처럼 전체 문장 한줄이 들어갑니다.
slTmp 는 StringList입니다.

 

진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

델파이 수학 함수 정리

Sqrt  System.pas
   
문 법
function Sqrt(X: Real): Real;
      X의 제곱근을 구하는 함수이다. Sqrt(2)는 1.414213이다.
이때 계산되는 제곱근은 양의 제곱근이다.

 

Sqrt
   
 
       

진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

[펌]쉽게 따라 하는 콤보박스 Object 삽입방법(1년미만 초보분만보세요)

퍼온곳 : 한국델파이동호회 델마당

URL :  http://www.delmadang.com/community/bbs_view.asp?bbsNo=3&bbsCat=0&st=S&keyword=%uCF64%uBCF4%uBC15%uC2A4&indx=197440&keyword1=콤보박스&keyword2=&page=1

 

중복이라면 댓글 달아주세요 삭제할께요..

1. Integer형 넣기

with Query do
begin
First;
while not(Eof) do
begin
Combobox1.Items.AddObject(FieldByName('상품명').AsString,
TObject(FieldByName('상품id').AsInteger));
Next;
end;
end;


빼쓰기

GoodID := LongInt(Combobox1.Items.Objects[Combobox1.ItemIndex]);


2. String형 넣기

with Query do
begin
First;
while not(Eof) do
begin
Combobox1.Items.AddObject(FieldByName('상품명').AsString,
TObject(LongInt(NewStr(FieldByName('상품id').AsString))));
Next;
end;
end;


빼쓰기

GoodID := PString(Combobox1.Items.Objects[combobox1.ItemIndex])^;


3. 잊지말고 메모리 해제합시다.

OnDestroy 이벤트에 코딩해줍니다.

for i := 0 to combobox1.Items.Count-1 do
DisposeStr(PString(combobox1.Items.Objects[i]));

진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

dateutils.pas

DateUtils.pas 날짜함수 정리


//일자를 추출한다.
function DateOf(const AValue: TDateTime): TDateTime;

//시간을 추출한다.
function TimeOf(const AValue: TDateTime): TDateTime;

//평년,윤년을 구분하다.
function IsInLeapYear(const AValue: TDateTime): Boolean;

//오전,오후를 구분한다.
function IsPM(const AValue: TDateTime): Boolean;

//Word형의 년,월,일 파라메타의 유효성을 체크한다.
function IsValidDate(const AYear, AMonth, ADay: Word): Boolean;

//Word형의 시,분,초,밀리초 파라메타의 유효성을 체크한다.
function IsValidTime(const AHour, AMinute, ASecond, AMilliSecond: Word): Boolean;

//Word형의 년,월,일,시,분,초,밀리초  파라메타의 유효성을 체크한다.
function IsValidDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word): Boolean;

//ex) IsValidDateDay(2006,45) : 2006년의 45번째날이 유효한지를 체크한다.
function IsValidDateDay(const AYear, ADayOfYear: Word): Boolean;

//ex) IsValidDateWeek(2006,42) : 2006년의 42주차가 유효한지를 체크한다.
function IsValidDateWeek(const AYear, AWeekOfYear,  ADayOfWeek: Word): Boolean;

//년,월,월의주차,요일  이  유효한지를  체크한다.
//ex) IsValidDateMonthWeek(2006,2,1,2) : 2006년 2월의 1주차의 화요일이 유효한지를 체크한다.
function IsValidDateMonthWeek(const AYear, AMonth, AWeekOfMonth, ADayOfWeek: Word): Boolean;

//ex) WeeksInYear(Today) : 오늘이 년의 몇주차인지 리턴한다.
function WeeksInYear(const AValue: TDateTime): Word;                
function WeeksInAYear(const AYear: Word): Word;            

//ex) DaysInYear(Today) : 오늘이 년의 몇일째인지 리턴한다.          
function DaysInYear(const AValue: TDateTime): Word;
function DaysInAYear(const AYear: Word): Word;

//ex) DaysInMonth(Today) : 오늘이 월의 몇일째인지 리턴한다.
function DaysInMonth(const AValue: TDateTime): Word;
function DaysInAMonth(const AYear, AMonth: Word): Word;

//오늘-
function Today: TDateTime;

//어제-
function Yesterday: TDateTime;

//내일-
function Tomorrow: TDateTime;

//AValue의 값이 오늘이면 True를 리턴한다.
function IsToday(const AValue: TDateTime): Boolean;

//AValue, ABasis 같은날이면 True를 리턴한다.
function IsSameDay(const AValue, ABasis: TDateTime): Boolean;


//년을 추출한다.
function YearOf(const AValue: TDateTime): Word;

//월을 추출한다.
function MonthOf(const AValue: TDateTime): Word;

//년의 몇주차인지를 추출한다.
function WeekOf(const AValue: TDateTime): Word;          

//일자만 추출한다.
//ex) DayOf(StrToDate('2006-06-27')) : 27을 리턴한다.
function DayOf(const AValue: TDateTime): Word;

//시간을 추출한다(24시간단위)
function HourOf(const AValue: TDateTime): Word;

//분을 추출한다.
function MinuteOf(const AValue: TDateTime): Word;

//초를 추출한다.
function SecondOf(const AValue: TDateTime): Word;

//밀리초를 추출한다.
function MilliSecondOf(const AValue: TDateTime): Word;

//년도의 시작일
function StartOfTheYear(const AValue: TDateTime): TDateTime;
function StartOfAYear(const AYear: Word): TDateTime;

//년도의 마지막일
function EndOfTheYear(const AValue: TDateTime): TDateTime;
function EndOfAYear(const AYear: Word): TDateTime;

//월의 시작일
function StartOfTheMonth(const AValue: TDateTime): TDateTime;
function StartOfAMonth(const AYear, AMonth: Word): TDateTime;

//월의 마지막일
function EndOfTheMonth(const AValue: TDateTime): TDateTime;
function EndOfAMonth(const AYear, AMonth: Word): TDateTime;

//주의 시작일
function StartOfTheWeek(const AValue: TDateTime): TDateTime;    

//주의 시작일(기준요일을 정할수 있다.)
//1:월요일, 2:화요일, 3:수요일, 4:목요일 ,5:금요일 , 6:토요일 ,7:일요일
function StartOfAWeek(const AYear, AWeekOfYear: Word; const ADayOfWeek: Word = 1): TDateTime;

//주의 마지막일
function EndOfTheWeek(const AValue: TDateTime): TDateTime;      

//주의 마지막일(기준요일을 정할수 있다.)
//1:월요일, 2:화요일, 3:수요일, 4:목요일 ,5:금요일 , 6:토요일 ,7:일요일
function EndOfAWeek(const AYear, AWeekOfYear: Word; const ADayOfWeek: Word = 7): TDateTime;



function StartOfTheDay(const AValue: TDateTime): TDateTime;
function StartOfADay(const AYear, AMonth, ADay: Word): TDateTime; overload;
function StartOfADay(const AYear, ADayOfYear: Word): TDateTime; overload;
function EndOfTheDay(const AValue: TDateTime): TDateTime;
function EndOfADay(const AYear, AMonth, ADay: Word): TDateTime; overload;
function EndOfADay(const AYear, ADayOfYear: Word): TDateTime; overload;


//ex) MonthOfTheYear(Today) : 오늘일자를 Word형으로 리턴한다.
function MonthOfTheYear(const AValue: TDateTime): Word;

//ex) WeekOfTheYear(Today) : 오늘일자가 몇주차인지를 Word형으로 리턴한다.
function WeekOfTheYear(const AValue: TDateTime): Word; overload;
function WeekOfTheYear(const AValue: TDateTime;  var AYear: Word): Word; overload;

//ex) DayOfTheYear(Today) : 오늘일자가 올해의 몇일째인지를 Word형으로 리턴한다.
function DayOfTheYear(const AValue: TDateTime): Word;

//년의 시작일부터  해당일자까지의 시간을  모두 더해서 Word형으로 리턴한다.
function HourOfTheYear(const AValue: TDateTime): Word;

//년의 시작일부터  해당일자까지의 분을 모두 더해서 Word형으로 리턴한다.
function MinuteOfTheYear(const AValue: TDateTime): LongWord;

//년의 시작일부터  해당일자까지의 초을  모두 더해서 Word형으로 리턴한다.
function SecondOfTheYear(const AValue: TDateTime): LongWord;

//년의 시작일부터  해당일자까지의 밀리초을  모두 더해서 Word형으로 리턴한다.
function MilliSecondOfTheYear(const AValue: TDateTime): Int64;

//이달의 몇번째주 인지를 리턴한다.
function WeekOfTheMonth(const AValue: TDateTime): Word; overload;
function WeekOfTheMonth(const AValue: TDateTime; var AYear, AMonth: Word): Word; overload;

//이달의 몇일째인지를 리턴한다.
function DayOfTheMonth(const AValue: TDateTime): Word;

//월의 시작일부터 해당일자까지의 시간의 합을 리턴한다.
function HourOfTheMonth(const AValue: TDateTime): Word;

//월의 시작일부터 해당일자까지의 분의 합을 리턴한다.
function MinuteOfTheMonth(const AValue: TDateTime): Word;

//월의 시작일부터 해당일자까지의 초의 합을 리턴한다.
function SecondOfTheMonth(const AValue: TDateTime): LongWord;

//월의 시작일부터 해당일자까지의 밀리초의 합을 리턴한다.
function MilliSecondOfTheMonth(const AValue: TDateTime): LongWord;

//해당일의 요일을 리턴한다.
//1:월요일, 2:화요일, 3:수요일, 4:목요일 ,5:금요일 , 6:토요일 ,7:일요일
function DayOfTheWeek(const AValue: TDateTime): Word;

//AValue날짜의 주의 시작일부터 AValue날짜까지의 시간의 합을 계산한다.
function HourOfTheWeek(const AValue: TDateTime): Word;              

//AValue날짜의 주의 시작일부터 AValue날짜까지의 분의 합을 계산한다.
function MinuteOfTheWeek(const AValue: TDateTime): Word;            

//AValue날짜의 주의 시작일부터 AValue날짜까지의 초의 합을 계산한다.
function SecondOfTheWeek(const AValue: TDateTime): LongWord;        

//AValue날짜의 주의 시작일부터 AValue날짜까지의 밀리초의 합을 계산한다.
function MilliSecondOfTheWeek(const AValue: TDateTime): LongWord;    

//ex) HourOfTheDay(Time) : 24시간 단위로 Time까지의 시간의 합을 계산한다.
function HourOfTheDay(const AValue: TDateTime): Word;

//ex) MinuteOfTheDay(Time) : 24시간 단위로 Time까지의 분의 합을 계산한다.
function MinuteOfTheDay(const AValue: TDateTime): Word;

//ex) SecondOfTheDay(Time) : 24시간 단위로 Time까지의 초의 합을 계산한다.
function SecondOfTheDay(const AValue: TDateTime): LongWord;

//ex) MilliSecondOfTheDay(Time) : 24시간 단위로 Time까지의 밀리초의 합을 계산한다.
function MilliSecondOfTheDay(const AValue: TDateTime): LongWord;

//ex) MinuteOfTheHour(13:28:43:345) : 시간을 기준으로 분의 합을계산한다.
function MinuteOfTheHour(const AValue: TDateTime): Word;

//ex) SecondOfTheHour(13:28:43:345) : 시간을 기준으로 초의 합을계산한다.
function SecondOfTheHour(const AValue: TDateTime): Word;

//ex) MilliSecondOfTheHour(13:28:43:345) : 시간을 기준으로 밀리초의 합을계산한다.
function MilliSecondOfTheHour(const AValue: TDateTime): LongWord;

//ex) SecondOfTheMinute(13:28:43:345) : 분을 기준으로 초의 합을 계산한다.
function SecondOfTheMinute(const AValue: TDateTime): Word;

//ex) SecondOfTheMinute(13:28:43:345) : 초을 기준으로 밀리초의 합을 계산한다.
function MilliSecondOfTheMinute(const AValue: TDateTime): LongWord;
function MilliSecondOfTheSecond(const AValue: TDateTime): Word;

{ Range checking functions }

function WithinPastYears(const ANow, AThen: TDateTime;
const AYears: Integer): Boolean;
function WithinPastMonths(const ANow, AThen: TDateTime;
const AMonths: Integer): Boolean;
function WithinPastWeeks(const ANow, AThen: TDateTime;
const AWeeks: Integer): Boolean;
function WithinPastDays(const ANow, AThen: TDateTime;
const ADays: Integer): Boolean;
function WithinPastHours(const ANow, AThen: TDateTime;
const AHours: Int64): Boolean;
function WithinPastMinutes(const ANow, AThen: TDateTime;
const AMinutes: Int64): Boolean;
function WithinPastSeconds(const ANow, AThen: TDateTime;
const ASeconds: Int64): Boolean;
function WithinPastMilliSeconds(const ANow, AThen: TDateTime;
const AMilliSeconds: Int64): Boolean;

{ Range query functions }

//두날짜(시간) 사이에 년수를 리턴한다.
function YearsBetween(const ANow, AThen: TDateTime): Integer;

//두날짜(시간) 사이의 월수를 리턴한다.
function MonthsBetween(const ANow, AThen: TDateTime): Integer;

//두날짜(시간) 사이의 주수를 리턴한다.
function WeeksBetween(const ANow, AThen: TDateTime): Integer;

//두날짜(시간) 사이의 일수를 리턴한다.
function DaysBetween(const ANow, AThen: TDateTime): Integer;

//두날짜(시간) 사이의 시간을 리턴한다.
function HoursBetween(const ANow, AThen: TDateTime): Int64;

//두날자(시간) 사이의 분을 리턴한다.
function MinutesBetween(const ANow, AThen: TDateTime): Int64;

//두날짜(시간) 사이의 초를 리턴한다.
function SecondsBetween(const ANow, AThen: TDateTime): Int64;

//두날짜(시간) 사이의 밀리초를 리턴한다.
function MilliSecondsBetween(const ANow, AThen: TDateTime): Int64;


//두날짜(시간) 사이를  Double형으로 리턴한다.
function YearSpan(const ANow, AThen: TDateTime): Double;
function MonthSpan(const ANow, AThen: TDateTime): Double;
function WeekSpan(const ANow, AThen: TDateTime): Double;
function DaySpan(const ANow, AThen: TDateTime): Double;
function HourSpan(const ANow, AThen: TDateTime): Double;
function MinuteSpan(const ANow, AThen: TDateTime): Double;
function SecondSpan(const ANow, AThen: TDateTime): Double;
function MilliSecondSpan(const ANow, AThen: TDateTime): Double;


//AValue일자에서 ANumberOfYears만큼의 년도를 증가한다.
function IncYear(const AValue: TDateTime; const ANumberOfYears: Integer = 1): TDateTime;

//AValue일자에서 ANumberOfWeeks만큼의 주를 증가한다.
function IncWeek(const AValue: TDateTime; const ANumberOfWeeks: Integer = 1): TDateTime;

//AValue일자에서 ANumberOfDays만큼의 일를 증가한다.
function IncDay(const AValue: TDateTime;  const ANumberOfDays: Integer = 1): TDateTime;

//AValue일자(시간)에서 ANumberOfHours만큼의 시간를 증가한다.
function IncHour(const AValue: TDateTime; const ANumberOfHours: Int64 = 1): TDateTime;

//AValue일자(시간)에서 ANumberOfMinutes만큼의 분를 증가한다.
function IncMinute(const AValue: TDateTime; const ANumberOfMinutes: Int64 = 1): TDateTime;

//AValue일자(시간)에서 ANumberOfSeconds만큼의 초를 증가한다.
function IncSecond(const AValue: TDateTime; const ANumberOfSeconds: Int64 = 1): TDateTime;

//AValue일자(시간)에서 ANumberOfMilliSeconds만큼의 밀리초를 증가한다.
function IncMilliSecond(const AValue: TDateTime; const ANumberOfMilliSeconds: Int64 = 1): TDateTime;

//년,월,일,시,분,초,밀리초  ---> 날짜(시간)형으로 리턴한다.
function EncodeDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word): TDateTime;

//날짜(시간)형 ---> 년,월,일,시,분,초,밀리초 Word형으로 리턴한다.
procedure DecodeDateTime(const AValue: TDateTime; out AYear, AMonth, ADay,  AHour, AMinute, ASecond, AMilliSecond: Word);

//ex) EncodeDateWeek(2006,25,2) : 2006년 25주차의 첫번째 화요일의  날자를 리턴한다.
function EncodeDateWeek(const AYear, AWeekOfYear: Word; const ADayOfWeek: Word = 1): TDateTime;

//ex) DecodeDateWeek(Today) : 오늘은 몇년 몇째주의 무슨요일인지를 리턴한다.
procedure DecodeDateWeek(const AValue: TDateTime; out AYear, AWeekOfYear, ADayOfWeek: Word);

//AYear년의 ADayOfYear번째일이 며칠인지 리턴한다.
function EncodeDateDay(const AYear, ADayOfYear: Word): TDateTime;

//AValue일자가 몇년의 몇일째인지를 구한다.
procedure DecodeDateDay(const AValue: TDateTime; out AYear, ADayOfYear: Word);

//년,월,월의몇주차,화요일 의 날짜를 리턴한다.
function EncodeDateMonthWeek(const AYear, AMonth, AWeekOfMonth, ADayOfWeek: Word): TDateTime;

//AValue의 년,월,월의몇주차, 요일 구한다.
procedure DecodeDateMonthWeek(const AValue: TDateTime; out AYear, AMonth, AWeekOfMonth, ADayOfWeek: Word);

//년,월,일,시,분,초,밀리초의 유효성을 체크하고 날짜를 구한다.
function TryEncodeDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond,  AMilliSecond: Word; out AValue: TDateTime): Boolean;

//AYear년의 AWeekOfYear주에 ADayOfWeek요일에 유효성을 체크하고 날짜를 리턴한다.
function TryEncodeDateWeek(const AYear, AWeekOfYear: Word;  out AValue: TDateTime; const ADayOfWeek: Word = 1): Boolean;

//AYear년의 ADayOfYear번째날에 유효성을 체크하고  날짜를 구한다.
function TryEncodeDateDay(const AYear, ADayOfYear: Word;  out AValue: TDateTime): Boolean;

//AYear(년) AMonth(월) AWeekOfMonth(월의주차)  ADayOfWeek(요일) 유효성을 체크하고 날짜를 구한다.
function TryEncodeDateMonthWeek(const AYear, AMonth, AWeekOfMonth,  ADayOfWeek: Word; var AValue: TDateTime): Boolean;


function RecodeYear(const AValue: TDateTime; const AYear: Word): TDateTime;
function RecodeMonth(const AValue: TDateTime; const AMonth: Word): TDateTime;
function RecodeDay(const AValue: TDateTime; const ADay: Word): TDateTime;
function RecodeHour(const AValue: TDateTime; const AHour: Word): TDateTime;
function RecodeMinute(const AValue: TDateTime; const AMinute: Word): TDateTime;
function RecodeSecond(const AValue: TDateTime; const ASecond: Word): TDateTime;
function RecodeMilliSecond(const AValue: TDateTime; const AMilliSecond: Word): TDateTime;
function RecodeDate(const AValue: TDateTime; const AYear, AMonth,  ADay: Word): TDateTime;
function RecodeTime(const AValue: TDateTime; const AHour, AMinute, ASecond,  AMilliSecond: Word): TDateTime;
function RecodeDateTime(const AValue: TDateTime; const AYear, AMonth, ADay,  AHour, AMinute, ASecond, AMilliSecond: Word): TDateTime;
function TryRecodeDateTime(const AValue: TDateTime; const AYear, AMonth, ADay,  AHour, AMinute, ASecond, AMilliSecond: Word; out AResult: TDateTime): Boolean;

//A.날짜(시간) B.날짜(시간) 을 비교한다. A=B(0) ,  A>B(1) ,  Afunction CompareDateTime(const A, B: TDateTime): TValueRelationship;
function CompareDate(const A, B: TDateTime): TValueRelationship;
function CompareTime(const A, B: TDateTime): TValueRelationship;


//A.날짜(시간) B.날짜(시간) 을 비교한다
function SameDateTime(const A, B: TDateTime): Boolean;
function SameDate(const A, B: TDateTime): Boolean;
function SameTime(const A, B: TDateTime): Boolean;

//오늘이 이달의 몇번째주인지 리턴한다.
function NthDayOfWeek(const AValue: TDateTime): Word;

//AValue날이 몇년,몇월,월의몇번째주,무슨요일 인지를 구한다.
procedure DecodeDayOfWeekInMonth(const AValue: TDateTime; out AYear, AMonth, ANthDayOfWeek, ADayOfWeek: Word);

//AYear(년), AMonth(월), ANthDayOfWeek(월의몇번째주),  ADayOfWeek(요일) ----> 해당일자를 리턴한다.
function EncodeDayOfWeekInMonth(const AYear, AMonth, ANthDayOfWeek,  ADayOfWeek: Word): TDateTime;

//AYear(년), AMonth(월), ANthDayOfWeek(월의몇번째주),  ADayOfWeek(요일) 의 유효성을 체크하고 날짜를 구한다.
function TryEncodeDayOfWeekInMonth(const AYear, AMonth, ANthDayOfWeek,  ADayOfWeek: Word; out AValue: TDateTime): Boolean;


procedure InvalidDateTimeError(const AYear, AMonth, ADay, AHour, AMinute,  ASecond, AMilliSecond: Word; const ABaseDate: TDateTime = 0);
procedure InvalidDateWeekError(const AYear, AWeekOfYear, ADayOfWeek: Word);
procedure InvalidDateDayError(const AYear, ADayOfYear: Word);
procedure InvalidDateMonthWeekError(const AYear, AMonth, AWeekOfMonth,  ADayOfWeek: Word);
procedure InvalidDayOfWeekInMonthError(const AYear, AMonth, ANthDayOfWeek,  ADayOfWeek: Word);


//날짜를 Double형으로 리턴한다.
//0001년01월01일  --->  1721425
function DateTimeToJulianDate(const AValue: TDateTime): Double;

//Double형을 날짜로 리턴한다.
//1721425 ---> 0001년01월01일
function JulianDateToDateTime(const AValue: Double): TDateTime;

//AValue의 유효성을 체크하고 날짜를 리턴한다.
function TryJulianDateToDateTime(const AValue: Double;  out ADateTime: TDateTime): Boolean;

//날짜를 Double형으로 리턴한다.
//0001년01월01일  --->  ( -678575  )
function DateTimeToModifiedJulianDate(const AValue: TDateTime): Double;

//Double형을 날짜로 리턴한다.
//( -678575  ) ---> 0001년01월01일
function ModifiedJulianDateToDateTime(const AValue: Double): TDateTime;

//AValue의 유효성을 체크하고 날짜를 리턴한다.
function TryModifiedJulianDateToDateTime(const AValue: Double;  out ADateTime: TDateTime): Boolean;


function DateTimeToUnix(const AValue: TDateTime): Int64;
function UnixToDateTime(const AValue: Int64): TDateTime;
진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

Delphi 연합세미나를 다녀와서..

오랫만의 세미나에 간만에 만나는 코드웨이 식구들에.. 여러가지로 즐거운 하루였습니다.
 
작년에도 그렇더니 올해도 세미나할 때 추운 날씨가 되는군요...
 
양병규님의 클래스 강의는 처음에는 무슨 이야기인줄 감을 못잡고 있다가 결론을 보니 저런 방식도 있나하고 놀라게 되었습니다. 강의 초반에 결과물을 먼저 보여주고 강의를 했다면 이해하기 훨씬 쉬웠을 거라는 아쉬움이 있었습니다.
 
Nick Hodges 의 세션은 영어와 통역으로 진행되어서 좀 산만한 감은 있었지만 개발자 커뮤니티를 적극적으로 지원하겠다는 계획과 다짐을 들은 점,이후의 장미빛 공약들(뭐 계획이고 약속은 아니라고 몇번씩 이야기하긴 했지만)을 들은 점으로 만족합니다. 질의응답 시간에 왜 비너스 사진이 없어졌나고 물어보니까 처음엔 뭔소린줄 모르고 어리둥절하더니 모른다 고 답변하던 모습이 기억에 남네요..
 
 
박지훈님의 프레임워크 강의는 실제 작업에 적용하면 멋질거라는 생각이 들었습니다. 매번 프로그램을 만들때마다 폼 열고 그위에 컴포넌트 올리고 하는 작업을 위자드로 작업할 수 있다면 편리함도 편리함이지만 일관성면에서도 좋을것 같습니다. 협력작업에서는 물론 그 빛을 발휘할것이구요.. 이런 식의 작업이 널리 퍼져서 각자의 경험에 맞는 방법론들이 공유된다면 생산성도 높아지겠습니다.
 
마지막의 김종상 선생님(이분은 정말 선생님입니다. 그것도 여고!!!)의 미리보기 인쇄하기 세션의 경우 선생님으로 학교업무에 이용하기 위해 델파이로 작업하시는 모습이 새롭고 좋았습니다. 세션의 내용또한 퀵리포트 같은 콤포넌트 이용이 아니라 델파이 기본기능만으로 구현되는 미리보기의 경우는 저도 필요한 부분이라 집중해서 들었는데 완결된 결과가 아니라 좀 아쉬웠습니다.
 
세미나 끝나고 난 이후의 뒷풀이 자리도 즐거웠고...린군은 생각했던 이미지 그대로고.. 곰순이는 아무래 해도 적응이 안되요.. 그 귀여운 별명에 어울리지 않는 덩치에 얼굴이라니..... 이번 티셔츠 참 예쁩니다. 게다가 xxx 라지의 경우 나한테 맞아요..ㅋㅋㅋ
 
세미나 끝내고 난 느낌은 아쉬운 마음이 더 큽니다.
 
당일 준비된 스탭의 문제의 경우 세미나 준비 초기부터 스탭을 모집해서 접수 페이지 작업이나 자료준비, 물품준비, 포스터를 만들어서 대학이나 프로그램 학원들에 붙이는 작업들을 진행했으면 좋았을 거라는 생각을 합니다. 이번에 스탭으로 일해보니 그냥 참석할 때보다는 책임감도 좀 있게 되는 것 같고 그런 스탭들을 가능한 많이 모집해서 준비단계부터 같이 한다면 충실한 준비 + 사람 의 효과를 얻을 수 있지 않나 생각합니다.
 
세미나 자료의 경우 좀 무리가 있다 하더라도(이번의 경우 델파이 연합 운영진들의 개인적인 노력으로 모든 일이 이루어졌다고 알고 있습니다.) 강의 자료집 정도는 나와야 할 것 같습니다.
 
 
준비하고 강의해주셨던 모든 운영진에게 감사드립니다. 수고하셧습니다.
진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

Delphi 2007 에서 zeos 컴포넌트 사용하기

-.인스톨

그동안 zeos 하면서 계속 헤매다가 이번에 정리한다.

1.최신 버전 받아오기

svn(서브버전 : 버전관리 프로그램)을 이용하여 svn://www.firmos.at/zeos/trunk 에서 받아온다.

2.디렉토리 위치

C:Program FilesCodeGearRAD Studio5.0lib 밑에 zeos 라는 폴더를 생성하고 그곳에 packages 와 src 두 폴더를 복사한다.

3.Library Path 잡기

Tools -> Options -> Delphi Options -> Library - Win32 ->Library Path 에서 오른쪽의 ... 버튼 클릭

하단의 ... 버튼을 클릭하여 src 밑의 폴더들을 하나씩 추가해준다.

4.Project 열기

File -> Open Project 를 선택하여 packages 밑의 delphi11 폴더에 있는 ZeosDbo.groupproj 파일을 선택하면 오른쪽의 Project Manager 에 아래와 같은 화면이 뜬다.



5.컴파일

상단의 메뉴에서 Project -> Complie all prject 를 선택하여 에러없이 모든 것이 컴파일 되면

6. ZComponent Build

ZComponent110.bpl 을 선택하여 오른쪽 마우스 클릭 -> build

7.ZComponent  를 디자인타임(작업중에 데이터베이스 연결등을 할  수 있게) 에 사용할 수 있게

ZComponentDesign110.bpl을 선택하여 오른쪽 마우스 클릭 -> build -> install 하면 화면에 디자인타임에 사용할 수 있는 컴포넌트가 인스톨되었다는 안내메시지가 나오면서 사용할 수 있게 된다.
진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

[펌]스트링 그리드에 포커스 넣기...

출처 : http://numz.net/numz/club/club.php?clid=delworld&cate=1164480739078

With StringGrid1 do begin
RowCount:=RowCount+1;//Row추가
Row:=RowCount-1 //Row Focus
end;
이렇게 하면 될것 같은데요..더 좋은 방법 있으면 알려주세요.
그럼.

> 안녕하세요...
>
>현재 제 스트링 그리드는 한줄씩 아래로 추가됩니다.
>한줄씩 추가될 때마다 지금 생기는 자료는 스크롤 바 아래로 추가되어
>보이지 않습니다.
>
>자료가 한 줄 추가될 때 추가될 자료의 줄에 포커스가 가서,
>그 자료가 있는 줄을 볼 수 있게 하려면 어떻게 해야 할까요...
>
>고수님들의 조언 부탁합니다.
>
>그럼 즐코들 하세요......

진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

TMS TAdvStringGrid

TAdvStringGrid : Frequently asked questions

Q1: When I try to install the package, it asks for AdvGrid.pas
package 를 인스톨할 때 AdvGrid.pas를 물어봅니다.

A1: Make sure the correct version of ADVGRID.DCU and other DCU files are in your library path, that your library path contains the directory where ADVGRID.DCU is installed and that no other versions of ADVGRID.DCU are in your library path. Note that the binary version of TAdvStringGrid cannot be used with Delphi or C++Builder trial versions.

당신이  library path 에 정확한 버전의 ADVGRID.DCU 와 다른 DCU 파일들이 있는지 확인해봅니다.


--------------------------------------------------------------------------------

Q2: When I run my application I get an error "property does not exist"

A2: An older version of ADVGRID.DCU might be in your library path. When upgrading from an older version, make sure to first open all forms in your application that use the grid, ignore property errors on opening, save form files and then rebuild your application.


--------------------------------------------------------------------------------

Q3: When try to install TAdvStringGrid, I get an error that TAdvStringGrid is compiled with a different version of PictureContainer

A3: Most likely another TMS component has been installed that is also using the PictureContainer. Due to strict binary compatibility checks of Delphi & C++Builder, it is causing problems to install multiple binary distributed components that share a unit. For using the binary versions, the only workaround is to install the packages alternatingly for evaluation. Registered versions that come with full source do not have this problem.


--------------------------------------------------------------------------------

Q4: I use OnGetEditorType to specify a checkbox but it only displays when editing

A4: Use a permanently visible checkbox that can be added with the AddCheckBox method


--------------------------------------------------------------------------------

Q5: I use row selection, but the first column has a different color

A5: Set goDrawFocusSelected = true in the Options property


--------------------------------------------------------------------------------

Q6: Why do rotated fonts do not print correct ?

A6: Toggle the value of the public property PrinterDriverFix: Boolean


--------------------------------------------------------------------------------

Q7: I want to use rotated font but the font does not show rotated

A7: Make sure to use a truetype font. Only truetype font can be rotated.


--------------------------------------------------------------------------------

Q8: Why do my printouts do not have colors or fonts set as displayed ?

A8: Assign the OnGetCellColor event to the OnGetCellPrintColor event as well.


--------------------------------------------------------------------------------

Q9: Copy and paste does not seem to work ?

A9: Make sure that Navigation.AllowClipboardShortCuts is true and the grid is either editable or Navigation.AllowClipboardAlways is true


--------------------------------------------------------------------------------

Q10: I want to select multiple rows with Ctrl - mouseclick and Shift - mouse click

A10: In the Options property set goRowSelect = true and set MouseActions.DisjunctRowSelect = true. The desired selection capabilities are enabled now.


--------------------------------------------------------------------------------

Q11: How can the copyright notice be removed from the grid ?

A11: The registered version of TAdvStringGrid does not show this copyright notice


--------------------------------------------------------------------------------

Q12: I am not sure if the latest version of TAdvStringGrid is installed. How can I check this ?

A12: At design time, right click on the grid and select About. At runtime, show the version with : ShowMessage(Grid.GetVersionString);


--------------------------------------------------------------------------------

Q13: When I try to install the trial version of TAdvStringGrid in the Delphi 6 or Delphi 7 trial version, it asks for ADVGRID.PAS ?

A13: The Delphi 6 or Delphi 7 trial edition does not allow to install binary component distributions. The registered source version of TAdvStringGrid will work with the Delphi 6 or Delphi 7 trial edition


--------------------------------------------------------------------------------

Q14: With the registered version of TAdvStringGrid, do we need to pay additional royalties for application distribution ?

A14: With license for commercial use of the registered version, no additional royalties need to be paid


--------------------------------------------------------------------------------

Q15: How can I set text in a cell ?  How do I programmatically change a column width or row height ?

A15: Setting text in a cell is done with the grid.Cells[col,row]: string propert. Setting the column width is done with grid.ColWidths[col]: Integer and setting a row height with grid.RowHeights[row]: Integer.  Note that TAdvStringGrid inherits ALL methods and properties of TStringGrid. As such, refer to the Borland documentation for TStringGrid for help on the basic grid functions


--------------------------------------------------------------------------------

Q16: How can I get the state of a checkbox added with grid.AddCheckBox ?

A16:

var
 state: Boolean;

grid.GetCheckBoxState(col,row,state);
if state then ShowMessage('CheckBox is checked') else ShowMessage('CheckBox is not checked');


--------------------------------------------------------------------------------

Q17: I get an exception 'invalid column' during export to Excel

A17: The maximum number of columns supported in Excel itself is 255. As such, it is not possible to export more columns than the Excel limit.


--------------------------------------------------------------------------------

Q18: I have added a button on the grid with AddButton but the OnButtonClick event is not triggered ?

A18: If you add a button to a non editable cell (or grid without editing enabled) the button is treated as disabled by default. To override this behaviour, set grid.ControlLook.NoDisabledButtonLook = true


--------------------------------------------------------------------------------

Q19: I try to set VAlignment to vtaCenter or vtaBottom but this is not working

A19: By default, wordwrap is enabled in the grid and it is a limitation of the Microsoft text drawing API's that wordwrapped text is always top aligned. To use the VAlignment capability, set WordWrap = false


--------------------------------------------------------------------------------

Q20: Can I load a gallery file programmatically at runtime ?

A20: Yes, call grid.LoadVisualProps(GalleryFileName);


--------------------------------------------------------------------------------

Q21: I am having problems with grid.SortByColumn, it is slow or behaves incorrect

A21: SortByColumn is a deprecated method, use grid.QSort instead with settings as defined under grid.SortSettings


--------------------------------------------------------------------------------

Q22: Users of older operating systems have an error message on application startup related to a missing gdiplus.dll

A22: Either redistribute the Microsoft GDIPLUS.DLL (explained in README.TXT) or remove the gdiplus.dll dependency by commenting the line {$DEFINE TMSGDIPLUS} in TMSDEFS.INC


--------------------------------------------------------------------------------

Q23: When exporting to Excel file with the method grid.SaveToXLS()  I get the error : "Excel OLE server not found"

A23: The method grid.SaveToXLS() uses OLE automation to export to Excel file and thus requires Excel to be installed on the machine. To avoid this requirement, you can use the component TAdvGridExcelIO to export to Excel.

진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크