Re: trap works funny

Thomas Michael Hagen <[email protected]>
Newsgroups gmane.mail.spam.crm114
Message-ID <[email protected]>
sorry, let me correct that:

with fault /1/ commented out, and file < limit, i get:

x=[filesize]

with fault /1/ commented out, and file > limit i get NO output. this
is where i should expect:

f:2
x:2
x=[filesize]

this experience is analog to what i experience i my main program as
well. something should happen as a result of my trap, but nothing
happens (other than the error message disappearing).


On Thu, Mar 12, 2009 at 1:31 PM, Thomas Michael Hagen
<[email protected]> wrote:
> when the file is bigger than the limit, you get:
>
> f:2
> x:2
> x=[some number that i assume is the size of the file in bytes]
>
> but i get, with the same code:
>
> f:1
> x:1
> x=[the size of the file in bytes]
>
> the output of crm -v is:
>
> This is CRM114, version 20080630-BlameVT (TRE 0.7.5 (LGPL))
>  Copyright 2001-2006 William S. Yerazunis
>  This software is licensed under the GPL with ABSOLUTELY NO WARRANTY
>
> the reason why i'm using this version is that it's a red hat package,
> which means it will be updated automatically, which makes the admin
> happy.
>
>
> On Thu, Mar 12, 2009 at 12:26 PM, Paolo <[email protected]> wrote:
>> On Thu, Mar 12, 2009 at 10:41:26AM +0100, Thomas Michael Hagen wrote:
>>>     {
>>>       input (:ffile:) [:*:name:]
>>>       trap /unable to read-open the file/
>>>       output /Couldn't read file! Trying next file.\n/
>>>       return
>>>
>>>       trap /program has overflowed/ #the file is too big for the machine's memory
>>>       output /File too big!\n/
>>>       return
>>>     }
>>
>> funny ... I get
>>
>> $ crm '-{window
>>  { isolate (:x:) //
>>    #input (:x:) [T.log]
>>    #fault /1/
>>
>>    trap /1/
>>    output /f:1\n/
>>    output /x:1\n/
>>
>>    trap /./
>>    output /f:2\n/
>>    output /x:2\n/
>>  }
>>  eval (:x:) /:#:x:/
>>  output /x=:*:x:\n/
>> }'
>>
>> with FAULT unabled:
>>
>> f:1
>> x:1
>> x=0
>>
>> with INPUT enabled, on f.size < limit:
>>
>> x=512106
>>
>> with INPUT enabled, on f.size > limit (-w 20000):
>>
>> f:2
>> x:2
>> x=15622
>>
>> which seems to WFM - pls try the above sample code on your side.
>>
>>
>> --
>>  paolo
>>
>>  GPG/PGP id:0x3A47DE45  - B5F9 AAA0 44BD 2B63 81E0  971F C6C0 0B87 3A47 DE45
>>
>> ------------------------------------------------------------------------------
>> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
>> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
>> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
>> software that enables intelligent coding and step-through debugging.
>> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
>> _______________________________________________
>> Crm114-general mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/crm114-general
>>
>

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.