joe at strout dot net wrote:
> On Sep 28, 2007, at 19:13 UTC, Fargo wrote:
>
>
>> They fail to initialize unless there's a msgbox in them.
>> Presumably other code items could achieve the same result, but I
>> haven't tried much, and none of what I tried would produce the
>> result. The timer class exhibits similar behavior, in that if it
>> will only fire once unless a msgbox is in the Action event.
>>
>
> A MsgBox has the effect of forcing an event loop to be serviced. I
> suspect that you've tied up the main event loop with some tight loop of
> your own. Instead, you should drive your animation either from a
> thread or a timer (I usually use a Timer in my own games).
>
> HTH,
> - Joe
>
> --
> Joe Strout -- joe at strout dot net
> Strout Custom Solutions, LLC
>
> _______________________________________________
>
So, I changed it some so that the other timer isn't being made, and it's
pretty much the same. Some further poking about has revealed, however,
some odd stuff.
Here's the constructor for the problematic class-
me.ship_of_interest = who
myWorld = where
dim myPump As new camPump
myPump.parent = me
myPump.Period = interval
myPump.Mode = Timer.ModeMultiple
myPump.Enabled = True
So, myPump is supposed to make a callback to camera adjusting functions,
but it just sits there. I added a second window to follow a variable,
and to see if the constructor was actually doing anything, and lo,
adding Window2.Show to the end of the constructor, the window opens
fine. But the timer, myPump, never ever fires. If I just add a msgbox to
the timer, no change, but if I just add a msgbox to the handler class
constructor, the timer class will operate until I dismiss the msgbox.....
HAHAHA!!! I finally saw it! While looking through here for details to
send, I noticed-
This line- dim myPump As new camPump
Is wrong, myPump is a property, so it should just be myPump = new camPump.
What weird behavior though. Man, I'm glad I finally tracked that down.
Teaches me to code at 2AM.
Thanks,
Fargo
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
From Fri 28 Sep 2007 15:05:59 -0600
Return-Path: <realbasic-nug-bounces at lists dot realsoftware dot com>
X-Original-To: listarchive at realsoftware dot com
Delivered-To: listarchive at realsoftware dot com
Received: by xmail.realsoftware.com (Postfix, from userid 1037)
id 0652F45238FC; Fri, 28 Sep 2007 14:06:08 -0700 (PDT)
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
www.realsoftware.com
X-Spam-Level:
X-Spam-Status: No, score=-3.1 required=4.5 tests=ALL_TRUSTED,AWL,BAYES_00,
NO_REAL_NAME autolearn=ham version=3.1.1
Received: from lists.realsoftware.com (m.realsoftware.com [66.116.103.65])
by xmail.realsoftware.com (Postfix) with ESMTP id 1817F45238EE;
Fri, 28 Sep 2007 14:06:07 -0700 (PDT)
Received: from real-software-mini.local (localhost [127.0.0.1])
by lists.realsoftware.com (Postfix) with ESMTP id 7AB1F6E2424;
Fri, 28 Sep 2007 16:05:48 -0500 (CDT)
X-Original-To: realbasic-nug at lists dot realsoftware dot com
Delivered-To: realbasic-nug at lists dot realsoftware dot com
Received: from mail.verex.com (mail.verex.com [66.116.103.197])
by lists.realsoftware.com (Postfix) with ESMTP id 897D26E2419
for <realbasic-nug at lists dot realsoftware dot com>;
Fri, 28 Sep 2007 16:05:44 -0500 (CDT)
Received: from [66.116.103.197] (localhost [127.0.0.1])
by mail.verex.com (Postfix) with SMTP id 712457D060F
for <realbasic-nug at lists dot realsoftware dot com>;
Fri, 28 Sep 2007 15:05:59 -0600 (MDT)
Date: Fri, 28 Sep 2007 15:05:59 -0600
Subject: Re: today's language quiz
From: joe at strout dot net
To: realbasic-nug at lists dot realsoftware dot com
In-Reply-To: <DC4E561D-E4BE-4141-9B89-740FA68766AE at declareSub dot com>
X-Mailer: VerEx Email Gateway
Message-Id: <20070928210559 dot 712457D060F at mail dot verex dot com>
X-BeenThere: realbasic-nug at lists dot realsoftware dot com
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: realbasic-nug-bounces at lists dot realsoftware dot com
Errors-To: realbasic-nug-bounces at lists dot realsoftware dot com
On Sep 28, 2007, at 19:40 UTC, Charles Yeomans wrote:
> See if you can guess what happens here, keeping in mind that
> REALbasic is advertised as a statically-typed language.
Any such claim goes out the window when Variants are involved... that
being the purpose of Variants, of course.
But your examples do nicely illustrate why Variants should be used
sparingly.
Best,
- Joe
--
Joe Strout -- joe at strout dot net
Strout Custom Solutions, LLC
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
From Fri 28 Sep 2007 15:10:20 -0600
Return-Path: <realbasic-nug-bounces at lists dot realsoftware dot com>
X-Original-To: listarchive at realsoftware dot com
Delivered-To: listarchive at realsoftware dot com
Received: by xmail.realsoftware.com (Postfix, from userid 1037)
id 7280F4523AEE; Fri, 28 Sep 2007 14:10:28 -0700 (PDT)
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
www.realsoftware.com
X-Spam-Level:
X-Spam-Status: No, score=-3.1 required=4.5 tests=ALL_TRUSTED,AWL,BAYES_00,
NO_REAL_NAME autolearn=ham version=3.1.1
Received: from lists.realsoftware.com (m.realsoftware.com [66.116.103.65])
by xmail.realsoftware.com (Postfix) with ESMTP id 5C22E4523AD6;
Fri, 28 Sep 2007 14:10:27 -0700 (PDT)
Received: from real-software-mini.local (localhost [127.0.0.1])
by lists.realsoftware.com (Postfix) with ESMTP id 03CB96E24BA;
Fri, 28 Sep 2007 16:10:09 -0500 (CDT)
X-Original-To: realbasic-nug at lists dot realsoftware dot com
Delivered-To: realbasic-nug at lists dot realsoftware dot com
Received: from mail.verex.com (mail.verex.com [66.116.103.197])
by lists.realsoftware.com (Postfix) with ESMTP id 335346E2489
for <realbasic-nug at lists dot realsoftware dot com>;
Fri, 28 Sep 2007 16:10:05 -0500 (CDT)
Received: from [66.116.103.197] (localhost [127.0.0.1])
by mail.verex.com (Postfix) with SMTP id 080717D0631
for <realbasic-nug at lists dot realsoftware dot com>;
Fri, 28 Sep 2007 15:10:19 -0600 (MDT)
Date: Fri, 28 Sep 2007 15:10:20 -0600
Subject: Re: Totally stumped by class initialization weirdness
From: joe at strout dot net
To: realbasic-nug at lists dot realsoftware dot com
In-Reply-To: <46FD67AE dot 7040107 at rpgportland dot com>
X-Mailer: VerEx Email Gateway
Message-Id: <20070928211019 dot 080717D0631 at mail dot verex dot com>
X-BeenThere: realbasic-nug at lists dot realsoftware dot com
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: realbasic-nug-bounces at lists dot realsoftware dot com
Errors-To: realbasic-nug-bounces at lists dot realsoftware dot com
On Sep 28, 2007, at 20:44 UTC, Fargo wrote:
> HAHAHA!!! I finally saw it! While looking through here for details to
> send, I noticed-
> This line- dim myPump As new camPump
> Is wrong, myPump is a property, so it should just be myPump = new
> camPump. What weird behavior though.
Not so weird. What you did was create a local timer that happened to
have the same name as the property. But local variables go out of
scope at the end of the method, so the timer you created was promptly
destroyed. Once destroyed, of course, it was unable to fire.
Best,
- Joe
--
Joe Strout -- joe at strout dot net
Strout Custom Solutions, LLC
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|