Real Software Forums
http://forums.realsoftware.com/

With ... End With
http://forums.realsoftware.com/viewtopic.php?f=13&t=45654
Page 1 of 1

Author:  TomazVDaSilva [ Sat Oct 20, 2012 3:49 pm ]
Post subject:  With ... End With

Is there anything as "With ... End With", how should re-write this code in RealBasic ?

Dim n As Long
If Rnd * 32 > 1 Then Exit Sub
n = getPt
If n = ptMax Then Exit Sub
With pt(n)
.v = True
.t = 0
.x = Int(Rnd * 480) + 16
.y = -16
.dy = 0
.r = 16
.p1 = 5
End With

Author:  MonkeybreadSoftware [ Sat Oct 20, 2012 4:07 pm ]
Post subject:  Re: With ... End With

Change the code. there is no with in RB.

Greetings
Christian

Author:  kermit [ Sat Oct 20, 2012 4:17 pm ]
Post subject:  Re: With ... End With

dim TheThing

theThing = pt(n)

theThing.v = True
theThing.t = 0
theThing.x = Int(Rnd * 480) + 16
theThing.y = -16
theThing.dy = 0
theThing.r = 16
theThing.p1 = 5

Author:  TomazVDaSilva [ Sat Oct 20, 2012 4:20 pm ]
Post subject:  Re: With ... End With

Thank You, disregard the same question I did before I saw your answer.

Author:  timhare [ Sat Oct 20, 2012 4:23 pm ]
Post subject:  Re: With ... End With

But note that you cannot convert an integer to an object reference. Return a pt from getPt and modify your test against ptMax somehow. I really can't recommend anything without more information.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/