问个很泛泛的问题,但却是我最想知道的~!
问题就是怎么使用C++ builder的帮助系统~~
呵呵~ 或者哪里有这样的教材何以叫我怎么使用它呢?因为我现在对C++ builder还没能形成整体概念呢!打个比方:我现在想实现一个功能:从一个数据库中随机抽出一条数据纪录,数据库的组件倒是好办,可以按照教材上面的做法一步一步建出来,能够连上数据库并显示出数据,然后我在一个按钮的OnClick事件上加上自己的代码,随机抽出一条数据并在旁边的一个Edit栏中显示出来,所以我就想去找帮助系统中随机函数这部分,找到了很多random相关的函数,比如:
RandomFrom
See also
Returns a randomly selected element from an array.
Unit
Math
or StrUtils
Category
random number routines
extern PACKAGE double __fastcall RandomFrom(const double *AValues, int AValues_Size);
extern PACKAGE int __fastcall RandomFrom(const int *AValues, int AValues_Size);
extern PACKAGE __int64 __fastcall RandomFrom(const __int64 *AValues, int AValues_Size);
extern PACKAGE AnsiString __fastcall RandomFrom(const AnsiString *AValues, int AValues_Size);
Description
RandomFrom returns a randomly selected element from the array passed as the AValues argument. AValues_Size is the index of the last array element (one less than the number of elements.)
To initialize the random number generator, add a single call Randomize or assign a value to the RandSeed variable before making any calls to RandomFrom.
我是不是应该使用这个函数呢?而且,我该如何在我的OnClick中使用这个(或其他应该使用的函数)呢?