Re: A new line may give correct printout ?? How ?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Four little changes (marked with --<<) should make you happy:

procedure draw_it()  
integer x                                                       --<< 
   sequence CoEff  
   object   number,Request  
   CoEff = repeat(0,20)   -- Initialise Sequence..20 zeroes  
   CoEff[2] = 1           -- Initialise Triangle Start  
   number=getNumber(EditText1)  
   Request = number + 1   -- Avoid Zero  
   across = 300        -- Where 1st row is  to start  
   down = 70  
   for Row = 1 to Request do  
      for i = 0 to across do    -- Pseudo Tab Function  
         wPuts({Window1,across,down},"  ")  
      end for  
      x = 0                                                     --<< 
      for Col = Row to 2 by -1 do  
        CoEff[Col] = CoEff[Col] + CoEff[Col-1]  
        wPuts({Window1,across+x,down},{"%8d",CoEff[Col]})       --<< 
        x += 40                                                 --<< 
      end for  
      down    += 10          -- Move down  
      across  -= 20          -- Move left  
  
      -- puts(1,"\n")       -- New line twice spacing triangle  
      -- puts(1,"\n")       --       in a readable way  
   end for  
end procedure 

Regards,
Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu