require 'gui/gtkwd
    Debugwd_gtkwd_=:1
    require 'gl2'
   load 'demos/wd/demos'
NB.wd;~Demos/wd/demos.ijs
NB.Use the above to launch from launchpad
NB. should this be  wd 'demos/wd/demos.ijs'
   wd'pshow'

   I'm trying to update all these little useful things for upgrading my old 
relics.

1.  Is the  D  in  Debugwd  only a capital or could it be small like the others?
2.  wiki has no response about  launchpad  and I only use it when I need to 
relax and play minesweeper.  How and when is it used? 

Linda

-----Original Message-----
From: programming-boun...@jsoftware.com 
[mailto:programming-boun...@jsoftware.com] On Behalf Of bill lam
Sent: Tuesday, February 21, 2012 1:49 AM
To: programming@jsoftware.com
Subject: Re: [Jprogramming] Control error when loading script into ijx window 
(J602)

I would suspect H L C are undefined.  My general approach is to
insert smoutput before and after every control switch, eg

smoutput 'a1'
for_i. i.(#a) do.
smoutput 'a2'

  currHi=. ". > (i { H)
  currLo=. ". > (i { L)
  currCl=. ". > (i { C)

  if. (0=i) do.
smoutput 'a3'
    diffHi=. 0
    diffLo=. 0
  else.                      <-------- control error here
smoutput 'a4'
    prevHi=. ". > ((i-1) { H)
    prevLo=. ". > ((i-1) { L)
    diffHi=. currHi - prevHi
    if. 0<:diffHi do. pivotHi=. currHi end.
smoutput 'a5'
    diffLo=. prevLo - currLo
    if. 0<:diffLo do. pivotLo=. currLo end.
smoutput 'a6'
  end.

smoutput 'a7'
  if. diffLo>diffHi do.
smoutput 'a8'
    if. currLo <: ( pivotHi * (1-swing) ) do.
smoutput 'a9'
      xx=. xx , currLo

Втр, 21 Фев 2012, PackRat писал(а):
> When loading a script to test, I get an immediate "control error" when 
> I give the command to load it.  The following is the portion of the 
> script that has all of the control structures.  I've drawn an arrow 
> pointing to the line where the error is supposed to have occurred.  I'm 
> probably "blind" to the error because I'm just not seeing the problem.
> 
> ================================================================
> 
> for_i. i.(#a) do.
> 
>   currHi=. ". > (i { H)
>   currLo=. ". > (i { L)
>   currCl=. ". > (i { C)
> 
>   if. (0=i) do.
>     diffHi=. 0
>     diffLo=. 0
>   else.                      <-------- control error here
>     prevHi=. ". > ((i-1) { H)
>     prevLo=. ". > ((i-1) { L)
>     diffHi=. currHi - prevHi
>     if. 0<:diffHi do. pivotHi=. currHi end.
>     diffLo=. prevLo - currLo
>     if. 0<:diffLo do. pivotLo=. currLo end.
>   end.
> 
>   if. diffLo>diffHi do.
>     if. currLo <: ( pivotHi * (1-swing) ) do.
>       xx=. xx , currLo
>     else.
>       xx=. xx , ( {: xx )    NB. repeat previous value
>     end.
>   else.
>     if. currHi >: ( pivotLo * (1+swing) )
>       xx=. xx , currHi
>     else.
>       xx=. xx , ( {: xx )    NB. repeat previous value
>     end.
>   end.
> 
> end.
> 
> ================================================================
> 
> The same error (at the same line) occurs if the following lines:
> 
>   if. 0<:diffHi do. pivotHi=. currHi end.
>   . . .
>   if. 0<:diffLo do. pivotLo=. currLo end.
> 
> are instead expanded to:
> 
>   if. 0<:diffHi do.
>     pivotHi=. currHi
>   end.
>   . . .
>   if. 0<:diffLo do.
>     pivotLo=. currLo
>   end.
> 
> 
> I would appreciate any assistance in "opening my eyes"--thanks in 
> advance!
> 
> 
> Harvey
> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
----------------------------------------------------------------------
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