Public Sub Form_Open()
Timer1.Trigger
End
Public Sub Second()
Print "Hello world!"
End
Public Sub Timer1_Timer()
Second
End
Program start
- cogier
- Site Admin
- Posts: 1128
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Program start
Has anybody go a way to start a Sub without coming back to Sub Form_Open(). I can do it with a Timer, as below, but it seems to me there should be an easier way.
Re: Program start
Can you elaborate on what it is you want to accomplish? Why is it that Form_Open() is not sufficient? You could call it from a different class or module if you make it public.
You can also call it at the constructor, a.k.a. _new() (probably _init() and _ready() as well).
You can also call it at the constructor, a.k.a. _new() (probably _init() and _ready() as well).
- cogier
- Site Admin
- Posts: 1128
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Program start
OK here is what I am working on. If you Rem out line 30 and run the program you will see the issue.
Re: Program start
Line 30?
Public Sub BuildForm() 'To add items to the Form
I do still not follow you friend - cogier
- Site Admin
- Posts: 1128
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Program start
Sorry. It's the last line in
Public Sub Form_Open()
hTimer1.trigger
Re: Program start
Have you uploaded the same version? The code you gave me calls BuildForm, which in turn calls AddTimer which again calles hTimer.Start...
Anyway... I still do not know why you want to avoid this? Can you tell me like I am five years old, haha
Anyway... I still do not know why you want to avoid this? Can you tell me like I am five years old, haha
- cogier
- Site Admin
- Posts: 1128
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Program start
Opps!
Sorry I uploaded an earlier version
Please see attached..
Sorry I uploaded an earlier version
Please see attached..
Re: Program start
I did not fully understand your code, but I tried to make a variant to what it seems you try to achieve:
- cogier
- Site Admin
- Posts: 1128
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Program start
I had a look at your code which works as I would expect. I just can't work out why mine needs a 'Trigger' to display.
Re: Program start
I added this code into the top of your RebuildForm sub:
Debug "Rebuilding form", hPlayAreaPanel.W, hPlayAreaPanel.H
and it says you panel is 8x8. That's probably the problem. Now to find out why it does not fit the FMain's proportions