[REBOL] sub faces Re:(2)

2000-08-11 Thread yaozhang


say,

view L: layout [ check label "parent" panel [ check label "sub" ]]
view L/pane/3


-z

--- [EMAIL PROTECTED] wrote:
 OK, I did get them to work. I just don't think I'm understanding
 things 
 correctly.
 
 Is it possible to create sub-faces within a parent face and have
 the sub-faces 
 display buttons, fields, etc.?
 
 
 
  The parent-face/sub-face examples from the /view documentation do
 not
  work.
  
  :-(
  
  Can someone give me an example on how to correctly create a
 layout which
  includes sub-faces???
  
  -Ryan
  
 
 


__
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/




[REBOL] Parse does not have not match type. Re:(6)

2000-08-01 Thread yaozhang

Thanks, Ladislav

so my reading - Object has local context
  local context could be GC'd if not referenced
  (self) below provide the reference

Thanks,
-z


--- [EMAIL PROTECTED] wrote:
 Hi Zhang,
 
 the problem is the GC bug. If the bug didn't exist, (self) is
 unnecessary. As long, as the GC bug exists, (self) prevents the GC
 from collecting O. (for more information you can read Words,
 Bindings and Contexts thread)
 
 Regards
 Ladislav
 
 
 
  hi put up the question just in case i missed something+
 
  seems could remove the (self) under bind/copy to achieve this
  function. or is it required for some reason?
 
 
  -z
 
  --- [EMAIL PROTECTED] wrote:
   Hi,
  
   the latest version (see below) is better (the generated rule
 can
   be used recursively if needed):
  
   A-B-rule: func [
   {Generate an A-B parse rule}
   A [block!] {A-rule}
   B [block!] {B-rule}
   /local o
   ] [
   o: make object! [
   A-rule: A
   B-rule: B
   res-rule: none
   ]
   bind/copy [
   (self) ; === here
   [
   B-rule (res-rule: [to end skip]) |
   (res-rule: A-rule)
   ]
   res-rule
   ] in o 'self
   ]
  
   {
   Example:
  
   a: [any "a" "b"]
   b: ["aa"]
   a-b: a-b-rule a b
   parse "ab" a-b
   parse "aab" a-b
   }
  
   not-rule: func [
   "Generate a not A parse rule"
   A [block!] {A-rule}
   /local o
   ] [
   o: make object! [
   A-rule: A
   res-rule: none
   ]
   bind/copy [
   (self)
   [
   A-rule (res-rule: [to end skip]) |
   (res-rule: [])
   ]
   res-rule
   ] in o 'self
   ]
  
   {
   Example:
  
   a: [any "a" "b"]
   not-a: not-rule a
   parse "ab" not-a
   parse "b" not-a
   parse "" not-a
  
   }
  
That's brilliant Ladislav. It took a little while to
 understand
   what magic
you put there, and I learnt something as a result.
   
I've made a few tests so far and cannot fault it.
   
Thanks,
Brett.
   
   
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 31, 2000 4:06 AM
Subject: [REBOL] Parse does not have "not" match type. Re:
   
   
 Hi, I think, that Parse has got a bug as in:

  parse "a" [none skip]
 == true

 cc-ing to feedback. Here is a version of A-B-rule, that
 should
 work reliably. Test it please.

 A-B-rule: func [
 "Generate an A-B parse rule"
 A [block!] {A-rule}
 B [block!] {B-rule}
 /local o
 ] [
 o: make object! [
 A-rule: A
 B-rule: B
 res-rule: none
 ]
 bind/copy [
 (self)
 [
 B-rule (res-rule: [to end skip]) |
 A-rule (res-rule: []) |
 (res-rule: [to end skip])
 ]
 res-rule
 ] in o 'self
 ]


   
   
   
  
 
 
  __
  Do You Yahoo!?
  Kick off your party with Yahoo! Invites.
  http://invites.yahoo.com/
 
 
 


__
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/




[REBOL] bug ? Re:(3)

2000-07-12 Thread yaozhang

yeee...i was thinking you 'read the files so 'difference on the
string! contents

and rebol seems prefer {"} over "^""

cheers,
-z

--- [EMAIL PROTECTED] wrote:
 
 Sorry, haven't read you properly. I realized my previous post was
 not
 about what you were talking about. And I think you might be right,
 too. I'll check it more thoroughly. Thanks !
 
  i would guess those are characters exist in one file but not
 another?
  and it use {} to brace cause " is one of the missing char.
 
 
  -z
 
  --- [EMAIL PROTECTED] wrote:
  
  Difference is a high-level function that returns the differences
  between two datasets. But datasets do not exist in Rebol
  (they're not a datatype), so difference accepts any series
  including
  strings. However, when you use it on the content of two files
 (read
  %file), you get a strange result :
  
   difference file1 file2
  == {:"39%.@{}!(^^4567)~}  
  
  --
  [EMAIL PROTECTED]
  http://perso.worldonline.fr/mutant
  
  
  
 
 
  __
  Do You Yahoo!?
  Get Yahoo! Mail – Free email you can access from anywhere!
  http://mail.yahoo.com/
 
 
 --
 [EMAIL PROTECTED]
 http://perso.worldonline.fr/mutant
 
 
 


__
Do You Yahoo!?
Get Yahoo! Mail – Free email you can access from anywhere!
http://mail.yahoo.com/




[REBOL] Changing relative paths to absolute ones. Re:

2000-07-06 Thread yaozhang


parse page: read http://www.server [ some [thru "SRC=^"" here:
(insert here "http://www.server")] to end ]


; not tested

-z

--- [EMAIL PROTECTED] wrote:
 Hello.
 
 I have been monitoring the progress of REBOL since its first
 release but 
 only now I will start to use it to do something usefull. I created
 a simple 
 script to read a web page and to send it to an email address (send
 user@host 
 read http://www.server). The problem is that there are lots of
 relative 
 references in this page (IMG SRC="/somedir/file.gif") and I need to
 change 
 all of these references to an absolute path (IMG
 SRC="http://www.server/
 somedir/file.gif").
 
 I think the problem would be solved if I search for all =" and
 change it 
 to ="http://www.server .
 
 How can I do that? Note that I didn't even understood the REBOL
 syntax 
 yet. :)
 
 Thanks.
 
 -Bruno
 
 


__
Do You Yahoo!?
Send instant messages  get email alerts with Yahoo! Messenger.
http://im.yahoo.com/




[REBOL] different 'feel for styles derived from the same root(style)?

2000-06-26 Thread yaozhang

; wanna define 2 text oriented styles, with different engage func, so
write :

cel-styles: stylize [
cel-text text [
rate: 2
feel/engage: func [face act event index][
  ...some...process...
]
]
cel-label label [
rate: 1
feel/engage: func [face act event index][
  ...some...other...process...
]
]
]

; _END_

now the second feel/engage definition will overwrite the first. face
with cel-text style will have feel/engage doing
...some...other...process...

what could i do? 

-z

__
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/




[REBOL] ping check? Re:

2000-06-22 Thread yaozhang

seems rebol dont handle ICMP  ?


-z

--- [EMAIL PROTECTED] wrote:
 Hi folks,
 
 Given an ip, how can I do a ping check in rebol?
 
 I would find this useful for raising the alarm for our clients.
 Is it possible?
 
 Thanks...
 
 -Anton.
 


__
Do You Yahoo!?
Send instant messages with Yahoo! Messenger.
http://im.yahoo.com/




[REBOL] How can I process a whole directory Re:

2000-06-21 Thread yaozhang

something alike, eh...

foreach file read %. [ if find file ".txt" [ insert tail filestream
read file ]]

?

-z


--- [EMAIL PROTECTED] wrote:
 Hello, I have a rebol script process a specific file. How can I add
 code to make
 it process all the files in the directory?
 
 I tried to change the following line
 FileStream: read/lines %files1.txt
 to
 FileStream: read/lines %mydir/*.txt
 
 But it didn't work. 
 
 Any quick fix for this script?
 
 Thanks
 
 tZ
 
 
 


__
Do You Yahoo!?
Send instant messages with Yahoo! Messenger.
http://im.yahoo.com/




[REBOL] How to insert in the file Re:

2000-06-21 Thread yaozhang


insert f: open %temp.dat "blablabla"
close f ; to write back


-z

--- [EMAIL PROTECTED] wrote:
 How can I insert a line into a file? I did the following:
 
 FileStream: read/lines %temp.dat
 
 foreach line FileStream [
 
 ..
 
 ]
 
 
 after I found the line, I need to insert another line in the file
 in front of
 the line I just found. How can I do it?
 
 I used insert %temp.dat "blablabla" but it didn't work.
 
 Thanks very much for any suggestion.
 
 Tiana
 


__
Do You Yahoo!?
Send instant messages with Yahoo! Messenger.
http://im.yahoo.com/




[REBOL] layout/style ? Re:(2)

2000-06-20 Thread yaozhang

hoho it doesn't complain now
...yet my 'feel is bugged...got something to do

thanks, Larry

-z

--- [EMAIL PROTECTED] wrote:
 Hi z
 
 Try
 
  view layout/parent  ..
 
 The name was changed from style to parent in Viewbeta 4.1.
 
 -Larry
 
 - Original Message - 
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, June 19, 2000 1:55 PM
 Subject: [REBOL] layout/style ?
 
 
  in /view i tried 
  
view layout/style [ ... ] [ cust-feel: make feel [
 ..some-feel.. ]
  ]
  
  and i got 
  
** Script Error: layout has no refinement called style.
  
  
  what am i suppose to do if (possible?) to adjust feel through
 layout?
  appreciate help.
  
  
  -z
  
  __
  Do You Yahoo!?
  Send instant messages with Yahoo! Messenger.
  http://im.yahoo.com/
  
 


__
Do You Yahoo!?
Send instant messages with Yahoo! Messenger.
http://im.yahoo.com/




[REBOL] layout/style ? Re:(2)

2000-06-20 Thread yaozhang

thanks. understand by 'stylize your able to stylize the sub-face
(face in pane?). not sure if it's capable of affect main face, which
created by 'layout?
events will be passed from main face to sub-face, yet it could be
neat (sometimes) to trap/process the event in the main. i am trying
to add hotkey to the view, which could have general effect across the
pane. 


-z

--- [EMAIL PROTECTED] wrote:
 
 
 [EMAIL PROTECTED] wrote:
 
  in /view i tried
 
view layout/style [ ... ] [ cust-feel: make feel [
 ..some-feel.. ]
  ]
 
 
 you can create your own styles:
 
 my-styles: stylize [txt24 text [font/size: 24]]
 view layout [styles my-styles txt24 "ahoy"]
 
 as for feel - it's just object, and so you can pass it to any face
 
 
 view layout [styles my-styles txt24 "ahoy" [print "ahoy"]]
 
 - if you add action block to VID dialect, 'layout func parser
 recognises
 it, and 'text object has assigned a a feel, and for the text it is
 'hot
 IIRC. You can change it via setting in your own style using
 'stylize...
 
  not sure if it will work that way though ... :-)
 
 -pekr-
 
 
 
 
  and i got
 
** Script Error: layout has no refinement called style.
 
  what am i suppose to do if (possible?) to adjust feel through
 layout?
  appreciate help.
 
  -z
 
  __
  Do You Yahoo!?
  Send instant messages with Yahoo! Messenger.
  http://im.yahoo.com/
 


__
Do You Yahoo!?
Send instant messages with Yahoo! Messenger.
http://im.yahoo.com/




[REBOL] open/direct not working right? Re:

2000-06-20 Thread yaozhang

once read the doc regarding port access to file
remember the /direct refine works somewhat like tape without rewind.
it point to the bigining when open, then move forward when 'write (in
your case)
i think it behave this way cause there's no buffer avail

yet you could use 'skip to locate the pointer when open. to rewind
back to head, have to 'close and 'open once more.

-z

--- [EMAIL PROTECTED] wrote:
 
 
 
 Hi, I tried to do this:
 %waste2 is just about 3 megs of junk data.
 I want to build %waste, a file with about a gigabyte of junk.
 
 x: read %waste2
 o: open/binary/direct %waste
 for i 1 300 1 [
   insert tail o x
 ]
 close o
 
 when I do this, the file doesn't usually grow.
 If it does, it always starts from the beginning as if the
 "tail o" part were ignored.  Is this just how /direct works?
 Why can't I seek to the end of the file and just append
 some data without some buffering getting in the way?
 If I don't say direct then rebol tries to buffer the whole file
 as a series, and needless to say crashes or says out of
 mem, etc. on large data like this.
 
 I finally discovered write/append but why can't I work with
 the file as a series properly?  My OS is NT and it certainly
 has random access to any part of the file, just as any
 part of the series, so you should have no trouble mapping
 the rebol series operations to the OS file operations.
 
 Has anybody reported this problem?
 I discovered it using /Core, have not tested /View yet.
 
 Thanks,
 -galt
 
 
 
 


__
Do You Yahoo!?
Send instant messages with Yahoo! Messenger.
http://im.yahoo.com/




[REBOL] layout/style ?

2000-06-19 Thread yaozhang

in /view i tried 

  view layout/style [ ... ] [ cust-feel: make feel [ ..some-feel.. ]
]

and i got 

  ** Script Error: layout has no refinement called style.


what am i suppose to do if (possible?) to adjust feel through layout?
appreciate help.


-z

__
Do You Yahoo!?
Send instant messages with Yahoo! Messenger.
http://im.yahoo.com/




[REBOL] set in object 'variable string Re:(3)

2000-06-07 Thread yaozhang

if it says 'new values' i would assume it says new value for existing
variable/item/attrib [what the name in rebol?] of the object. 

say, in your case, you can set new value for 'x
yet 'y was not defined in the object...



-z

--- [EMAIL PROTECTED] wrote:
 This is not an option. The documentation says you can "set in" new
 values 
 to an existing object. But it is not working on /core for WinNT. Is
 the 
 documentation incorrect or...
 
  may have to create another object?
  
  test-obj-2: make test-object [
  y: "another string"
  ]
 


__
Do You Yahoo!?
Yahoo! Photos -- now, 100 FREE prints!
http://photos.yahoo.com