Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Tads 3 programming question...
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Conrad  
View profile   Translate to Translated (View Original)
 More options 9 Nov, 14:04
Newsgroups: rec.arts.int-fiction
From: Conrad <conradc...@gmail.com>
Date: Mon, 9 Nov 2009 06:04:20 -0800 (PST)
Local: Mon 9 Nov 2009 14:04
Subject: Tads 3 programming question...
Guys, this is a tricky one:

I have two pieces of code I want to be able to mix and match, rather
than having to re-code them every time, spaghetti-wise.

One of them is a bubblesort-like iterator:  think of a nested for
loop, with a few error-catching if-thens, and you've got it.

Now, what that's doing at the heart of it is checking a certain value
of an object, to see if it has a better value than the current max.

That's one piece of code.  The other is simply the value and condition
(both) that is being checked.  Do I want a minimum or a maximum?  On
what field?  That stuff.

Now, I can easily extract the for loop into its own procedure, and I
can have it call another procedure to check the condition.  But I'd
have to somehow tell the for-loop procedure what new condition to
check every time I wanted to implement something new.

So, how do I pass an arbitrary condition (or procedure) into the for-
loop procedure?  Or do I do something with object inheritence?  Or do
I throw in the towel and make spaghetti code?

I want to get this right so I don't create problems for myself later
on in the project.  I can imagine in a few months looking at this code
and wondering what the hell I was thinking...  I'd rather just do it
neatly.

Conrad.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
George Oliver  
View profile   Translate to Translated (View Original)
 More options 9 Nov, 15:47
Newsgroups: rec.arts.int-fiction
From: George Oliver <georgeolive...@gmail.com>
Date: Mon, 9 Nov 2009 07:47:11 -0800 (PST)
Local: Mon 9 Nov 2009 15:47
Subject: Re: Tads 3 programming question...
On Nov 9, 6:04 am, Conrad <conradc...@gmail.com> wrote:

> So, how do I pass an arbitrary condition (or procedure) into the for-
> loop procedure?  Or do I do something with object inheritence?

I think you've answered your own question -- you want to pass it in as
an argument

This is a handy reference -- read down to the section 'Referring to
Local Variables':

http://random.xem.us/tads3/t3anonfn.htm


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Conrad  
View profile   Translate to Translated (View Original)
 More options 10 Nov, 03:43
Newsgroups: rec.arts.int-fiction
From: Conrad <conradc...@gmail.com>
Date: Mon, 9 Nov 2009 19:43:56 -0800 (PST)
Local: Tues 10 Nov 2009 03:43
Subject: Re: Tads 3 programming question...
On Nov 9, 10:47 am, George Oliver <georgeolive...@gmail.com> wrote:

> On Nov 9, 6:04 am, Conrad <conradc...@gmail.com> wrote:

> > So, how do I pass an arbitrary condition (or procedure) into the for-
> > loop procedure?  Or do I do something with object inheritence?

> I think you've answered your own question -- you want to pass it in as
> an argument

> This is a handy reference -- read down to the section 'Referring to
> Local Variables':

> http://random.xem.us/tads3/t3anonfn.htm

Okay, I think I grok that.  Thanks, George!

Conrad.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google