Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Dec 14, 2019 4:51 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: VB6 Form_Load equivalent in Real
PostPosted: Sun May 15, 2011 7:35 am 
Offline

Joined: Sat May 14, 2011 10:45 pm
Posts: 35
I dont mind rewriting my VB6 program in Real and have already started but
What is the equivalent of Form_Load in Real


Top
 Profile  
Reply with quote  
 Post subject: Re: VB6 Form_Load equivalent in Real
PostPosted: Sun May 15, 2011 8:04 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
there is no direct equivalent.....

use WINDOW1.SHOW or WINDOW1.SHOWMODAL which ever is appropriate


the appropirate event is WINDOW1.OPEN

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: VB6 Form_Load equivalent in Real
PostPosted: Wed May 18, 2011 12:12 am 
Offline

Joined: Thu Oct 05, 2006 11:45 pm
Posts: 1002
Location: Sol:Planet Earth:North America:California
drd9494 wrote:
I dont mind rewriting my VB6 program in Real and have already started but
What is the equivalent of Form_Load in Real


Hi. If I remember correctly isn't Form_Load a sub that is called when your form is opening for the first time?

Would the window's Open event be similar? It fires when the window is about to be opened followed by the Activate event.

_________________
This message made with 100% recycled pixels.
MacBook CD2.0/2GB/OSX 10.6.8 / REAL Studio 2010R1 Pro


Top
 Profile  
Reply with quote  
 Post subject: Re: VB6 Form_Load equivalent in Real
PostPosted: Wed May 18, 2011 10:44 am 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:48 am
Posts: 3554
Location: Lenexa, KS
I would use the Window.Open event myself.

_________________
Bob K.

A blog about being a Real Studio/Xojo developer at http://www.bkeeneybriefs.com


Top
 Profile  
Reply with quote  
 Post subject: Re: VB6 Form_Load equivalent in Real
PostPosted: Wed May 18, 2011 1:06 pm 
Offline
User avatar

Joined: Wed Nov 15, 2006 3:50 pm
Posts: 2353
Location: England
Quote:
I would use the Window.Open event myself.


I agree, although I have to say.. it does not always fire (your mileage may vary, but I speak from direct experience)...
So I have taken to checking whether stuff has been initialised in both Open and Activate.

If you put all your initialisation in a method called Init, you can set a flag there to say initialised = true

In Both Open and Activate, you can then say

if initialised = false then call init


It will only fire once, but it ensures that ll your initialisation is done before any part of the window uses it.


Top
 Profile  
Reply with quote  
 Post subject: Re: VB6 Form_Load equivalent in Real
PostPosted: Wed May 18, 2011 1:17 pm 
Offline
Site Admin
User avatar

Joined: Fri Sep 30, 2005 9:35 am
Posts: 987
Location: South Portland, Maine
As others have mentioned, the Open event is probably the closest replacement.

However, depending on what you are doing in Form_Load, you might also want to consider using the Window Constructor.

_________________
Paul Lefebvre
Developer Evangelist
Xojo, Inc.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group