File: root - diary - 2007 - 2007-06 - 2007-06-19_01.19AM.html
Tags: 学习笔记, Learning Notes, | English | Home Page | Category: Computing | 20865 Views, 50557 Search Bots | 114 Words
| Browse | Archive
![Subscribe to Feed Burner Subscribe to Feed Burner](/images/form/rss.gif)
Tags: 学习笔记, Learning Notes, | English | Home Page | Category: Computing | 20865 Views, 50557 Search Bots | 114 Words
![Subscribe to Feed Burner Subscribe to Feed Burner](/images/form/rss.gif)
I was stuck the whole afternoon in debugging... finally i found something interesting...
Every time Delphi's Dynamic Array , (setLength fun) is extended, the original array cells' addresses may be changed...
Because I use TTreeView to link its Data (Pointer) to a particular cell of a dynamic array.
e.g.
TreeView.Data:=@dynamic_array[i];
and
unfortunately, the program adds one cell to dynamic_array somewhere...
setLength(dynamic_array,length(dynamic_array)+1);
the original cells' address are totally different, which is really confusing....
anyway, i solved this by taking the alternative...
TreeView.Data:=Pointer(i);
when i use it, i go for something like this..
dynamic_array[integer(TreeView.Data)];
Haha, everything works out finally.
Tags: 学习笔记, Learning Notes, | English | Home Page | Category: Computing | 20865 Views, 50557 Search Bots | 114 Words Every time Delphi's Dynamic Array , (setLength fun) is extended, the original array cells' addresses may be changed...
Because I use TTreeView to link its Data (Pointer) to a particular cell of a dynamic array.
e.g.
TreeView.Data:=@dynamic_array[i];
and
unfortunately, the program adds one cell to dynamic_array somewhere...
setLength(dynamic_array,length(dynamic_array)+1);
the original cells' address are totally different, which is really confusing....
anyway, i solved this by taking the alternative...
TreeView.Data:=Pointer(i);
when i use it, i go for something like this..
dynamic_array[integer(TreeView.Data)];
Haha, everything works out finally.
![Subscribe to Feed Burner Subscribe to Feed Burner](/images/form/rss.gif)
Related Articles
- Daily Interview Problem: Reconstrunct Binary Tree from Preorder and Inorder Traversals
- Daily Interview Puzzle: Ways to Traverse a Grid
- Algorithm Interview: Determine If Linked List is Palindrome
- Daily Interview Question: Longest Sequence with Two Unique Numbers
- Daily Interview Problem: Maximum Profit From Stocks
- Daily Interview Problem: Longest Substring With K Distinct Characters
- Algorithm Interview: Lowest Common Ancestor of 2 Nodes in Binary Tree
- Daily Interview Problem: Merge List Of Number Into Ranges
- Daily Interview Problem: Merge Overlapping Intervals
- [Daily Problem] Longest Increasing Subsequence
©2006~2024 SteakOverCooked - 0.01154 Seconds(s) - 4604.484 KB/s - 21 Online
Memory: 529.76 KB
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />
![](/images/top.jpg)
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
Read & Write - Normal - Mini - Post - All Comments - Statistics
Be the first one to comment this page !