RANDOM() visual

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

RANDOM() visual

Post by AUGE_OHR »

hi,

i want to generate "random Point"

Code: Select all

   mX := RANDOM( aSize[1]-2 )
   mY := RANDOM( aSize[2]-2 )
   ::Circle(mX,mY,3,nColor,,.T.)

Code: Select all

METHOD DemoDlg:Circle(X0,Y0,R0,nColor,nLineType,lFill)

   draw ellipse in window MainForm ;
   at Y0,X0 to Y0+3,X0+3 ;           //  X0,Y0 to X0+3,Y0+3    
   pencolor {random(255),random(255),random(255)} penwidth 2 fillcolor {random(255),random(255),random(255)}

RETURN NIL
now look at Picture ... Point are NOT "random" ...
RANDOM.jpg
RANDOM.jpg (85.93 KiB) Viewed 1438 times
i have made a Logfile with data and that "seems random" but if you "visualize" it you see this Result
RANDOM.ZIP
(23.43 KiB) Downloaded 122 times
so how to generate "random" Number under harbour / HMG :idea:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: RANDOM() visual

Post by AUGE_OHR »

have use Data in Excel
Random_Excel_Chart.JPG
Random_Excel_Chart.JPG (95.52 KiB) Viewed 1426 times
why does RANDOM() Data have that Look :(
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: RANDOM() visual

Post by AUGE_OHR »

hi,

have now use hb_RandomInt() instead of RANDOM() and got this
hb_RandomInt.jpg
hb_RandomInt.jpg (266.46 KiB) Viewed 1420 times
so it seems RANDOM() is not working as expect ...
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: RANDOM() visual

Post by AUGE_OHR »

hi,

why is

Code: Select all

mt=yes
HbDTL_MT.JPG
HbDTL_MT.JPG (83.31 KiB) Viewed 1376 times
slower than

Code: Select all

mt=no
HbDTL_NOMT.JPG
HbDTL_NOMT.JPG (313.27 KiB) Viewed 1376 times
in this Sample :idea:
have fun
Jimmy
Post Reply