Hi Elan:
        Thanks as allways for your help. I note that I'm not
the only C/C++ programmer dealing with paradigm shifts.
Now I can insert a line... great! Next step is to disable
the Rebol-Security Check prompt. I note that it can be accomplished
by Rebol start-up. 
;==============================================================
1)How may I do that from the code itself?
2)How may I control other options from the code?
3)Where is that info contained in the Rebol system? (the
  more I can help myself, the less I have to "bug" you)
Note the following code that I have written:
;==============================================================
fp: open/allow/mode  %test.txt [read write] [lines]
  forall fp
  [
    if(find first fp "three")
    [
      print first fp
      insert next fp "line four"
    ]
  ]
update fp
close fp
;============================================================== 
>Hi Tim,
>
>1. Your code causes an error, before it completes executing:
>>> fp: open/lines/write %test.txt
>>>   forall fp
>** Script Error: forall expected body argument of type: block.
>** Where: forall fp
>
>
>2. help open states that:
>>> help open
>Opens a new port connection.
>Arguments:
>    spec --  (file url port object block)
>Refinements:
>    /write -- Write only.  Disables read operations.
>
>The /write refinement disables read operations!
>
>
>Solution:
>
>Use the /mode refinement with a block [lines read write] like this:
>
>>> print read %test.txt
>line one
>line two
>line three
>line five
>
>>> fp: open/mode %test.txt [lines read write]
>
>forall fp [ 
>  if found? find first fp "three" [ 
>    insert next fp "line four" 
>  ] 
>]
>== false
>>> update fp
>>> close fp
>>> print read %test.txt
>line one
>line two
>line three
>line four
>line five
>
>
>
>;- Elan >> [: - )]
>
>

Reply via email to