;Aspect script demonstrating RANDINT.DLL
integer hdll, rNum
proc cleanup
  dllfree hdll
  exit
endproc

proc main
string DLLPATH = "e:\ADK\ASPECT\RANDINT.DLL" ;path to the DLL

  when userexit call cleanup              ;point to cleanup routine
  dllload DLLPATH hdll                    ;load the DLL
  if (failure)
    usermsg "dllload failed"
    exit
  endif

  ;generate a random number letting the DLL use system time as seed
  dllcall hdll "RandomInt" rNum
  if (failure)
    usermsg "RandomInt call with system time seed failed"
    cleanup()
  else
    usermsg "RandomInt with system time seed returned %d" rNum
  endif

  ;generate a random number with the seed 65
  dllcall hdll "RandomInt" 65 rNum
  if (failure)
    usermsg "RandomInt call with seed 65 failed"
    cleanup()
  else
    usermsg "RandomInt with seed 65 returned %d" rNum
  endif

  cleanup()
endproc
