is there a built in random function?

162 views
Skip to first unread message

Michael Green

unread,
Jan 17, 2026, 9:30:34 AMJan 17
to Harbour Users
I searched and didn't find a built in random function. Am I missing something? I suppose I  could write my own, but I'd prefer to use a native one.  

miro....@gmail.com

unread,
Jan 17, 2026, 10:01:44 AMJan 17
to Harbour Users
hbmk2 -find "hb_rand"

Harbour core (installed):
   hb_rand32()
   hb_randInt()
   hb_randNum()
   hb_Random()
   hb_RandomInt()
   hb_RandomIntMax()
   hb_RandomSeed()
   hb_randStr()

n := hb_RandomInt( 1, 20 ) //generates random number between 1 and 20

Michael Green

unread,
Jan 18, 2026, 10:49:39 AMJan 18
to Harbour Users
Thanks for that. Can anyone direct me to a reference source  for those please? Ta</North of England vernacular>

miro....@gmail.com

unread,
Jan 22, 2026, 10:05:03 AMJan 22
to Harbour Users
goto https://github.com/harbour/core
and put function name in search box.
Reply all
Reply to author
Forward
0 new messages