Learning J from using and observing the utils 
Author Message
 Learning J from using and observing the utils

I finf that the best way to learn J is to use the utilities that come
with J and then once in a while look at how one particular utility is
working.

Take one of the most useful utility in Visual J, "wdinfo"

This is a simple little verb and yet so powerful and useful

You can give it a string and it will display it on the screen.
Give it a boxed array and it will give you a title as well.

NB. syntax: wdinfo [title;] message

wdinfo'Hallo';'Gosi'
gives me a box titled "Hallo" and inside the box is little icon and the
text "Gosi". It is very impressive to present this to onlookers.

Give it a three (or more) item box and only the last two are used.
 wdinfo'test';'Hallo';'Gosi'
gives the same results as the one above.

Now look at the verb:

  wdinfo=: 3 : 0
NB. syntax: wdinfo [title;] message
'ab'=. _2{. boxopen y.
if. 2=#$b=. ":b do. b=. }.,LF,.b end.

empty wd 'mb ',(f a),' ',(f b),' mb_iconinformation'
)

The first line is a comment with the syntax (important) and then the
first line to execute picks the text from the user:
'ab'=. _2{. boxopen y.

Now "a" hold the optional title and "b" the text to be placed in the
box.

The last line calls windows and puts the text out plus the icon.

I am not suggesting to learn everything from the verb at the first
look into it. Pick out and learn a few of the techniques used and
try to figure out what the verb is doing. I find it stimulating
and it gives me ideas for my own coding.

--

http://www.*-*-*.com/ ~gosi
http://www.*-*-*.com/



Tue, 29 Sep 1998 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. JS-EAI with *JS*-callback

2. js.exception 3279.js

3. examples using JS to control vrml 2.0 wrls?

4. using myVar[] with JS validation

5. TOTALLY observing a Computer...

6. Observing a raster pattern with Intensity Graph

7. Observing multiple observables

8. Observing Status and Control words in Turbo Debugger

9. ANNOUNCE: Observing a Subject's Attributes article posted

10. Observing signals (and variables?) in a process

11. Observing nodes in a VHDL Simulation

12. Turbo debugger: how to observe the status and control words on Pentium

 

 
Powered by phpBB® Forum Software