Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

faq

 [1/6] from: rebol665::ifrance::com at: 19-Jan-2002 12:43


Hi Rebollers A simple one. <faq>Where did rebol store days and months names ? short answer : in system/locale/days and system/locale/months illustration : foreach item system/locale/days [print item] Monday Tuesday Wednesday Thursday Friday Saturday Sunday foreach item system/locale/months [print item] January February March April May June July August September October November December </faq> Patrick

 [2/6] from: rebol665:ifrance at: 19-Jan-2002 12:41


Hi rebollers, <remainder>When something seems to me not obvious, or difficult to remember, I made a memo of it. From time to time, I rewrite this memo too make a FAQ. I intend to make these FAQ available in a near future. Every new FAQ is first sent to the reboller for remark and validation.</remainder> How to initialize a check-box ? Short answer : With 'with [data: on] Problem illustration : In the following layout, both checks are unchecked, which is the default. Rebol [title: "FAQ"] view center-face layout [ banner "Check-boxes" across check text "check box n° 1" check text "check box n° 2" ] Problem resolution : Rebol [title: "FAQ"] view center-face layout [ banner "Check-boxes" across check with [data: on] text "check box n° 1" check with [data: off] text "check box n° 2" ] Patrick

 [3/6] from: rebol665:ifrance at: 19-Jan-2002 12:47


Hi Rebollers Another FAQ from the time where I was asking myself and the Rebollers "Is Rebol suited for Object Oriented programming ?" and got no response :( <faq> How to pass function as argument? Short answer: Using 'get Problem illustration: An object function must be set to an outside function. obj: make object! [ name: "obj" obj-func: none ] fn1: does [print "Hello Rebollers"] fn2: func [ f [function!] ][ print "My task is to affect obj/obj-func with fn1" obj/obj-func: f ]
>> fn2 fn1
Hello Rebollers ** Script Error: fn2 expected f argument of type: function ** Where: do-boot ** Near: fn2 fn1
>>
Problem resolution Get must be used twice: (1) in the fn2 definition. (2) in the fn2 call. fn2: func [ f [function!] ][ print "My task is to affect obj/obj-func with fn1" obj/obj-func: get 'f ] fn2 get 'fn1 My task is to affect obj/obj-func with fn1 obj/obj-func Hello Rebollers </faq> Patrick

 [4/6] from: greggirwin:mindspring at: 19-Jan-2002 9:25


Hi Pat, << Problem resolution Get must be used twice: (1) in the fn2 definition. (2) in the fn2 call. fn2: func [ f [function!] ][ print "My task is to affect obj/obj-func with fn1" obj/obj-func: get 'f ] fn2 get 'fn1 >> You could also use the get-word syntax to avoid evaluation of the function during assignment: fn2: func [ f [function!] ][ print "My task is to affect obj/obj-func with fn1" obj/obj-func: :f ] fn2 :fn1 --Gregg

 [5/6] from: rebol:optushome:au at: 20-Jan-2002 7:36


> Problem resolution : > Rebol [title: "FAQ"]
<<quoted lines omitted: 4>>
> check with [data: off] text "check box n° 2" > ]
Just using on or off (yes, no, true, false) will suffice.. Rebol [title: "FAQ"] view center-face layout [ banner "Check-boxes" across check on text "check box n° 1" check off text "check box n° 2" ] Cheers, Allen K

 [6/6] from: rebol665:ifrance at: 20-Jan-2002 11:01


Thanks Allen As often the more simple the best ! Rebol is so simple sometimes. May be I have a tendancy to complicate things. Patrick ----- Original Message ----- From: "Allen Kamp" <[rebol--optushome--com--au]> To: <[rebol-list--rebol--com]> Sent: Saturday, January 19, 2002 10:36 PM Subject: [REBOL] Re: [faq]
> Problem resolution : > Rebol [title: "FAQ"]
<<quoted lines omitted: 4>>
> check with [data: off] text "check box n° 2" > ]
Just using on or off (yes, no, true, false) will suffice.. Rebol [title: "FAQ"] view center-face layout [ banner "Check-boxes" across check on text "check box n° 1" check off text "check box n° 2" ] Cheers, Allen K

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted