最新の更新情報

2012年5月
« 4月    
 12345
6789101112
13141516171819
20212223242526
2728293031  

本ブログのURL

qrcode.png

お天気

 
このブログ「吟遊詩人の戯言」 の記事検索...

DelphiのString型をChar配列とみなすときのインデックス開始番号


キーワード(クリックで関連記事が読めます) → , ,

関連記事



 
 

C言語だと,0スタート(文字列型なんかないけど(汗)
C#だと,0スタート

VBは,確か,1スタート(じゃなかったっけ?(w))


DELPHIは,1スタートです

いつも迷う...

サンプル書いておきます

DELPHI:
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. var
  3.     st : string;
  4.     i : integer;
  5. begin
  6.     st := 'ABC';
  7.  
  8.     //label1.Caption := st[0];              //<--エラー
  9.     label1.Caption := st[1];
  10.     label2.Caption := st[2];
  11.     label3.Caption := st[3];
  12. end;

 
 
 
 

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <img localsrc="" alt="">