LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2003, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 4 Dec 2003 16:57:42 -0500
Reply-To:     Ian Whitlock <WHITLOI1@WESTAT.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Ian Whitlock <WHITLOI1@WESTAT.COM>
Subject:      Re: THANKS***PROBLEM USING RANUNI AND FLOORFUNCTIONTOCREATEFAKE D
              ATA***
Comments: To: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Content-Type: text/plain

Jack,

Was your decision to switch from SAS to Visual Basic arbitrary or necessary? In what SAS functions are arguments passed by reference? It seems to me clear that Dale was considering only the "SAS like part" of other languages when he made the statement.

Would you consider, your example VB code an illustration of a good programming practice, or just a legal one?

I recently ran across a quote, "I try to be right no more than necessary." I would change it to, "It is better to be reasonable than right." I do not think that is an arbitrary decision. :)

IanWhitlock@westat.com

-----Original Message----- From: Jack Hamilton [mailto:JackHamilton@FIRSTHEALTH.COM] Sent: Thursday, December 04, 2003 4:36 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: THANKS***PROBLEM USING RANUNI AND FLOORFUNCTIONTOCREATEFAKE DATA***

"Dale McLerran" <stringplayer_2@YAHOO.COM> wrote:

>I don't know of any language which allows variables passed in as >arguments to a function to be updated.

This Visual Basic program:

===== Sub outer() Dim x As Integer, y As Integer

x = 1 Debug.Print x

y = Inner(x)

Debug.Print x; y

End Sub

Function Inner(ByRef z As Integer) As Integer

z = 3

Inner = 2

End Function =====

prints this:

===== 1 3 2 =====

I no longer have access to a PL/I compiler, but I'm pretty sure that it also allows the modification of arguments passed by reference.

I'm also pretty sure, based on the documentation, that Perl allows the value of a parameter passed by reference; Davis Cassell can confirm or deny that.

-- JackHamilton@FirstHealth.com Manager, Technical Development Metrics Department, First Health West Sacramento, California USA


Back to: Top of message | Previous page | Main SAS-L page