Graphic User Interface (GUI) Functions

Aurora has a number of File Input/Output (IO) functions included as standard compiler and library functions. These functions can be grouped as follows:





Absolute Value Function - ABS

otherdoublenum = ABS ( doublenum );

Description

  Returns the absolute value of a number.

Parameter:

  doublenum - double precision variable or number to take the absolute value of.

Return value:

  The absolute value is returned as a double precision number (double).

Usage:

absolutevalue = abs( -1.5 );

Remarks:

  In the example above,   abs(-1.5) = 1.5

Numeric / Algebraic Functions


top of page



Random Number Generator Functions - SEEDRND, RAND, RND

SEEDRND ( intnum );

unsigned int = RAND ( usint, optmaxi );

float = RND ( num , optmaxf );

Description

  The SEEDRND function works with the RAND and RND functions. The SEEDRND function seeds the random number generator with a specific value.

  The RAND function creates a pseudo random number {Maximum random range is 0 <= number <= 65535}.

  The RND function creates a pseudo random number {Maximum random range is -32765.0 <= number <= 32766.0}.

Parameter:

  for SEEDRND intnum shall be an integer value (int)

  for RAND usint is the beginning or ending number for the range, and shall be an unsigned integer value (unsigned int),

  for RAND optmaxi is an optional interger value, that if given, the random number will be between num and optmaxi. Otherwise random number will be between 0 and num.

  for RND num shall be a floating point number value (float),

  for RND optmaxf is an optional floating point value, that if given, the random number will be between num and optmaxf. Otherwise random number will be between 0 and num.

Return value:

  There is no value returned for SEEDRND().

  The pseudo random number returned for RAND() is an integer.

  The pseudo random number returned for RAND() is a single precision number (float).

Usage:

  //  random.src
  global sub main()
  {
   seedrnd ( 10021959 );
   writeln ( str$( rand ( 100, 25 ) ) + "\n" );
   writeln ( str$( rnd ( 15.5, 5.0 ) ) + "\n" );
   while (GetKey() = "");
   return;
  }

Remarks:

  On program execution the random number generator seed is set to the current Windows tick count guaranteeing that a repeating random sequence is unlikely to occur. If you use the same seed (by using the SEEDRND function) every time then the random sequence will be identical on successive runs.

top of page


prev


next


Intrinsically Defined Constants TRUE = 1; FALSE = 0; NULL = 0; Intrinsic Data Types NONE = 0; const TYPE_STRING = 0x01; const TYPE_BYTE = 0x02; const TYPE_WORD = 0x03; const TYPE_INT = 0x04; const TYPE_INT64 = 0x05; const TYPE_FLOAT = 0x06; const TYPE_DOUBLE = 0x07; const TYPE_USER = 0x08; const TYPE_VPARAM = 0x09; const TYPE_DATABLOCK = 0xA; const TYPE_POINTER = 0xB; const TYPE_HEAP = 0xC; const TYPE_DSTRING = 0xD; For Integer Types represent an unsigned quantity const TYPE_UNSIGNED = 0x00010000; DECLARE EXTERN AllocHeap(nSize as unsigned int),unsigned int; DECLARE EXTERN FreeHeap(lpMem as unsigned int),INT; DECLARE EXTERN PushHeap(lpMem as unsigned int); DECLARE EXTERN HeapClear(); DECLARE EXTERN PopHeap(count as INT); DECLARE EXTERN _dupstr(in as STRING),HEAP; DECLARE CDECL EXTERN _strappend(STRING str1,STRING str2),HEAP; DECLARE EXTERN __POWER(base as DOUBLE,exponent as DOUBLE),DOUBLE; DECLARE EXTERN __NEW(int type,int size),unsigned int; DECLARE EXTERN __DELETE(unsigned int p); //list classes struct _linked_list { _linked_list *pNext; _linked_list *pPrev; pointer pData; } class CList { declare CList(); declare _CList(); declare Create(); declare Remove(_linked_list * pos,opt int bDelete = false),pointer; declare RemoveAll(opt int bDelete = false); declare GetFirst(),pointer; declare GetNext(_linked_list * pos),pointer; _linked_list *m_pList; } class CIntList : CList { declare Add(int value),pointer; declare AddHead(int value),pointer; declare GetData(_linked_list * pos),int; } class CStringList : CList { declare Add(string value,opt int cbSize = 255),pointer; declare AddHead(string value,opt int cbSize = 255),pointer; declare GetData(_linked_list * pos),string; } class CPointerList : CList { declare Add(pointer value),pointer; declare AddHead(pointer value),pointer; declare GetData(_linked_list * pos),pointer; }