begin
Result := IntToStr(RowNumber);
end.
今日番号は RowNumber関数 で取得します。
行番号は数値型(Integer)のため、IntToStr関数 で文字列型(string)に変換します。
begin
Result := FormatDateTime('yyyy/mm/dd', Date);
end.
今日の日付は Date関数 で取得します。
FormatDateTime関数 で日付型(TDateTime)を文字列型(string)に変換します。
var
CellA: string; //A列のセルの値
DateA: TDateTime; //A列の日付
NextDate: TDateTime; //A列の日付の翌日の日付
begin
CellA := Cell(1);
DateA := StrToDate(CellA);
NextDate := IncDay(DateA);
Result := FormatDateTime('yyyy/mm/dd', NextDate);
end.
CSVファイルのセルの値は Cell関数 で取得します。
//A列のセルの値を取得する
CellA := Cell(1);
取得したセルの値を StrToDate関数 で日時型(TDateTime)に変換します。
//A列のセルの値を日時型に変換する
DateA := StrToDate(CellA);
日時型(TDateTime)の値に、 IncDay関数 で日数を1日追加します。
//A列の日付に1日を加え翌日の日付にする
NextDate := IncDay(DateA);
FormatDateTime関数 で日付型(TDateTime)を文字列型(string)に変換します。
//文字列に変換してセルの値に設定する
Result := FormatDateTime('yyyy/mm/dd', NextDate);
begin
Result := StringReplace(Cell(1), ',', '', [rfReplaceAll]);
end.
セルの値からカンマを削除するには、StringReplace関数 を使用します。