Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Reginald -- passing stemmed variable
I have 26 stemmed variables named WA , WB, WC, ... WZ.
I want to perform certain operations (including sorting) on
each variable, in turn.

How may I do this?
I've fumbled around with variations on CALL and INTERPRET,
but not found the way.   Please advise.

Daniel B. Martin

/* This is a contrived example.
It is included here for illustrative purposes only.  */

/* Sort the voter lists.  */
Alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
do j = 1 to length(Alphabet)
string = 'call SortThem W' || substr(Alphabet,j,1) || '.'
interpret string
end j

exit

/* Sort Routine  */
SortThem:   procedure
arg  W.
SORT W. A B
return

Report this thread to moderator Post Follow-up to this message
Old Post
Daniel B. Martin
03-25-08 12:33 AM


Re: Reginald -- passing stemmed variable
"Daniel B. Martin" <daniel88b88martin@earthlink88.net> wrote:

> I have 26 stemmed variables named WA , WB, WC, ... WZ.
> I want to perform certain operations (including sorting) on
> each variable, in turn.
>
> How may I do this?

I don't know, but why have 26 separate stem variables, when you could place
all the data in one variable?  Eg if you made

WC.   into MyWStem.3.

and WF.   into MyWStem.6.   and so on,

then you could dispense with the interpret stuff.  That's assuming that
Reginald's SORT verb lets you do something like:

SORT MyWStem.3. A B

On theother hand it may just be that your

SortThem:   procedure
arg  W.
SORT W. A B
return

needed to have an "expose" argument on the "procedure" statement.




--
Jeremy C B Nicoll - my opinions are my own.

Report this thread to moderator Post Follow-up to this message
Old Post
Jeremy Nicoll - news posts
03-25-08 12:33 AM


Re: Reginald -- passing stemmed variable
Jeremy Nicoll - news posts wrote:
> I don't know, but why have 26 separate stem variables, when you could plac
e
> all the data in one variable?

Your point is correct but there is good reason to have the
26 different stem variables.

Daniel B. Martin

Report this thread to moderator Post Follow-up to this message
Old Post
Daniel B. Martin
03-25-08 12:33 AM


Re: Reginald -- passing stemmed variable
"Daniel B. Martin" <daniel88b88martin@earthlink88.net> wrote:

> Jeremy Nicoll - news posts wrote:
 
>
> Your point is correct but there is good reason to have the
> 26 different stem variables.

I can't think of one...    I doubt it'd make any difference to the way the
program works or its efficiency.

--
Jeremy C B Nicoll - my opinions are my own.

Report this thread to moderator Post Follow-up to this message
Old Post
Jeremy Nicoll - news posts
03-25-08 12:33 AM


Re: Reginald -- passing stemmed variable
>Daniel B. Martin
>I have 26 stemmed variables named WA , WB, WC, ... WZ.
>I want to perform certain operations (including sorting) on
>each variable, in turn.

Utilize the USE ARG instruction in your subroutine, and pass the stem itself
 to
the subroutine.

Type "USE" (minus the quotes) into an RPC editor window, highlight it, and
press F1. That brings up the help page for USE ARG.

Something like:

do_sort(MyStem.)
RETURN

do_sort:
USE ARG var.
SORT var. A
RETURN

Report this thread to moderator Post Follow-up to this message
Old Post
Jeff Glatt
03-25-08 12:33 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Rexx archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:08 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.