You can do

('pattern' sprintf var;var) 1!:3 <'C:\logfile.txt'

to append to a trace.

J uses the Iverson Convention, where there are no values true and false, 
but comparisons produce 0 for false and 1 for true.

Most J verbs are liable to produce arrays when given array operands;
for that reason, if. statements are not used as much as in other 
languages (if one element of an array matches the test, what do you do 
with the others?).  We use verbs that have decisions built into the 
definition of the verb.  >. for example.

if. value do.
end.

will execute the statements inside the do. end. if the first atom in 
value is nonzero or if value is empty.


Tracy: the statement that e. looks up items of x inside y is true only 
if those items have the same rank.  More precisely, e. looks at cells of 
x that have the rank of an item of y.

Henry Rich

Sprague, Webb (OFM) wrote:
>> rtn e. <'NO'
>>
>> will check each atom of rtn to see if the atom is
>> <'NO'
>> and if there are no atoms in rtn, or if the first one is <'NO',
>> the test will be declared true.
> 
> In the languages I am familiar with there would need to be an "==" or
> some such in there.  Is "element of" like a Boolean?
> 
>> load 'printf'  NB. Do this just once per session
>>
>> 'return value: %s' printf <rtn
> 
> I will try it.
> 
> Note to the people talking about console output -- the issue is that I
> need to run a script (~1000 lines) and check the input and output at
> various places, and at some point I will need to add file I/O to the
> script, so this is also a baby step toward that.  Plus, learning file
> I/O is one of the steps to getting my bearings in a new language.
> 
> Thx
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to