[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

closure & local_variables

Marcin Mielzynski

3/3/2006 9:46:00 PM

Hello,

given:

l=lambda{p local_variables;p a}
a=:whatever
l[]

I know that 'a' variable shoud not be visible for closure, but why
local_variables reports that it exists ? Is this behaviour intended ?

lopex
3 Answers

Logan Capaldo

3/3/2006 10:05:00 PM

0


On Mar 3, 2006, at 4:48 PM, Marcin Mielzynski wrote:

> Hello,
>
> given:
>
> l=lambda{p local_variables;p a}
> a=:whatever
> l[]
>
> I know that 'a' variable shoud not be visible for closure, but why
> local_variables reports that it exists ? Is this behaviour intended ?
>
> lopex
>

l is closing over main, main has a local_variables method, that is
what is being called not the proc's local_variables.



Yuu

3/3/2006 10:10:00 PM

0

Marcin MielżyÅ?ski wrote:
> Hello,
>
> given:
>
> l=lambda{p local_variables;p a}
> a=:whatever
> l[]
>
> I know that 'a' variable shoud not be visible for closure, but why
> local_variables reports that it exists ? Is this behaviour intended ?

Well, #local_variables is a method call so it resolves
at call time (at which point a is included). You could
also #eval 'a' at that point :)

> lopex


E

--
Posted via http://www.ruby-....


Tim Williams

5/9/2008 3:50:00 AM

0

Is the CSV file linked from a URL on a page, or the result of a form
submission ?

If a link (or form submission using GET) then you could probably download it
directly using xmlHttp.

Tim


"Dave N" <DaveN@discussions.microsoft.com> wrote in message
news:A3338DA5-BD10-4E63-B5B1-232F03E6A7E4@microsoft.com...
> Thanks for your help with this Tom,
> My application runs in Excel and I am using the Internet Explorer object
> model (references the WebBroser Control - ShDocVw.dll). What I really need
> to
> know is is there a way of changing the default Save As directory through
> this
> or any other way while using VBA? You mentioned changing the registry
> using
> WScript.Shell object - can this be done in VBA?
> Regrards
> Dave
>
> "T Lavedas" wrote:
>
>> On May 7, 12:22 pm, Dave N <Da...@discussions.microsoft.com> wrote:
>> > Hi,
>> > I need some help with automating Internet Explorer using VBA. I have an
>> > application to runs a report on our Internet based system and which can
>> > be
>> > downloaded as a csv file. In order to save this file into the correct
>> > location I need to change the directory that intintially pops up in the
>> > 'Save
>> > As' dialog box. This defaults to the last location used. Can anyone
>> > please
>> > suggest a way of doing this? For example, in Excel I would use the
>> > ChDir
>> > statement, is there a similare statement for IE?
>> > Any help would be much appreciated!
>> > Dave
>>