[REBOL] Re: default offset
First of all examine the source of layout: ?? layout ... Near the top we see the code Gabriele pointed out, below. The paths to those two default, offsets are: pick pick pick second :layout 10 3 6 == [25x50] pick pick pick second :layout 10 3 7 == [25x25] system/version == 1.2.10.3.1 Hmm, so the second one is used in my rebol version. Let's change the code: poke pick pick second :layout 10 3 7 [420x190] == [all [offset where] either all [(system/version/4 = 2) (system/version/5 = 3)] [25x50] [420x190] ] Now test: view layout [button] ; (window appears at offset 420x190) This is a way to change the default window position (that layout gives you anyway.) Anton. So the default is the offset of the face you provide. If you use LAYOUT, inside it (at the beginning) there's: if not parent [new-face/offset: any [all [offset where] either all [(system/version/4 = 2) (system/version/5 = 3)] [25x50] [25x25] ]] Regards, Gabriele. -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: Demo
Very nice. Here's the direct link: http://www.agora-dev.org/forums/getfile.php?key=1065244177att_id=94site=re bolbn=rebol_prjevolutions I saw a slight, but regular, delay while it is playing. I'm on WinXp 933MHz Pentium 3. Anton. Hello ! You can found a new demo here. http://rebol.agora-dev.org/ Rubriques: Suggestions Sujet Title: Animation. Jscops -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] dns asyn and dns spam server
Example code to use dns async and dns async with spam server. http://www.rebol.it/~romano/#sect3.1. --- Ciao Romano -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] url or file ?
Hi List, I already know how to test url and file. url? http://www.rebol.net == true file? %index.html == true But what if these came as strings test: [http://www.rebol.net; index.html] == [http://www.rebol.net; index.html] url? first test == false file? second test == false In my case, I have to decide between url and file. How can i do? Regards Patrick -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] edit-text
Other changes to my site. Among others things, i have added a patch for area and field: edit-text-undo.r which should fix area and field behaviour. It also and optional undo/redo and Esc key (to fields, like in Windows) Please, let me know if it does not work. --- Ciao Romano -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: url or file ?
Hi Patrick, p But what if these came as strings test: [http://www.rebol.net; index.html] p == [http://www.rebol.net; index.html] url? first test p == false file? second test p == false p In my case, I have to decide between url and file. How can i do? How about this? url? load http://www.rebol.net; == true url? load index.html == false OK, so this gives you a choice of URL or not-URL, but it still might work. :) -- Gregg -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: url or file ?
Thanks Gregg, I came to the same solution but ... load fails with some value: s: recipes/0001.html == recipes/0001.html s == recipes/0001.html load s ** Syntax Error: Invalid decimal -- 0001.html ** Near: (line 1) recipes/0001.html And I have no idea how to workaround this easily. Regards Patrick - Original Message - From: Gregg Irwin [EMAIL PROTECTED] To: patrick [EMAIL PROTECTED] Sent: Saturday, October 04, 2003 6:48 PM Subject: [REBOL] Re: url or file ? Hi Patrick, p But what if these came as strings test: [http://www.rebol.net; index.html] p == [http://www.rebol.net; index.html] url? first test p == false file? second test p == false p In my case, I have to decide between url and file. How can i do? How about this? url? load http://www.rebol.net; == true url? load index.html == false OK, so this gives you a choice of URL or not-URL, but it still might work. :) -- Gregg -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject. -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: url or file ?
Patrick: I came to the same solution but ... load fails with some value: ... And I have no idea how to workaround this easily. Load is not good if the values do not translate into REBOL words or datatypes. You may need to surround it with an error/try: s: recipes/0001.html loaded-s: form s error? try [loaded-s: load s] loaded-s is either now the original as a string, or the loaded values. Also, load can be dangerous if the string is untrusted. Try this: load rebol [quit] It'll exit your console. So you probably really need to use load/all. That returns a block, so your original code may need to become: s: recipes/0001.html loaded-s: form s error? try [loaded-s: first load/all s] Sunanda. -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: url or file ?
Hi Patrick, how are you? patrick wrote: Hi List, I already know how to test url and file. url? http://www.rebol.net == true file? %index.html == true But what if these came as strings test: [http://www.rebol.net; index.html] The problem here (apart from the 'load problems already discussed), is that rebol won't understand a file that is written in non Rebol format (that is, without the leading % sign). A function that will do the trick, as long as you are certain there will only be urls and files in your data, is this: string-to-url-or-file: func [s [string!] /local uf][ either url? uf: attempt[load s ] [uf][to file! s]] ] When your data is a url, load should always succeed, so attempt returns either a url, or somthing else, or none (e.g., if load failed) in the latter cases we just convert it to a file. test: [http://www.rebol.net; index.html] == [http://www.rebol.net; index.html] repeat d test [ print [ f dtype? f d ]] http://www.rebol.neturl index.htmlfile Kind regards, Ingo -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: url or file ?
Patrick wrote: But what if these came as strings test: [http://www.rebol.net; index.html] == [http://www.rebol.net; index.html] url? first test == false file? second test == false Then it's best to use my url and file patterns: test: [http://www.rebol.net; index.html] == [http://www.rebol.net; index.html] parse test/1 [url^ end] == true parse test/2 [url^ end] == false parse test/2 [file^ end] == true parse test/2 [url^ end] == false Caution: 'file^ has only been tested on Windows and some internet file names! Andrew J Martin Grail Jedi ICQ: 26227169 http://www.rebol.it/Valley/ http://valley.orcon.net.nz/ http://Valley.150m.com/ -- [ Rebol [ Name: 'Patterns Title: Patterns File: %Patterns.r Author: A J Martin Owner: Aztecnology Rights: Copyright 2003 A J Martin, Aztecnology. eMail: [EMAIL PROTECTED] Web: http://www.rebol.it/Valley/ Needs: [%Map.r] Tabs: 4 Language: 'English Date: 14/August/2003 Version: 1.1.0 ] Fail^: [to end skip]; A rule that always fails. Succeed^: []; A rule that always succeeds. Octet: charset [#^(00) - #^(FF)] Digit: charset 0123456789 Digits: [some Digit] Upper: charset [#A - #Z] Lower: charset [#a - #z] Alpha: union Upper Lower Alphas: [some Alpha] AlphaDigit: union Alpha Digit AlphaDigits: [some AlphaDigit] Control: charset [#^(00) - #^(1F) #^(7F)] Hex: union Digit charset [#A - #F #a - #f] HT: #^- SP: # LWS: charset reduce [SP HT #^(A0)] LWS*: [some LWS] LWS?: [any LWS] LF: #^(0A) WS: charset reduce [SP HT newline CR LF] WS*: [some WS] WS?: [any WS] Sign^: [#+ | #-] Integer^: [opt Sign^ Digits] Decimal^: [opt Sign^ Digits #. Digits] Tuple^: [1 3 Digit some [#. 1 3 Digit]] Graphic: charset [ #^(21) - #^(7E) #^(80) #^(82) - #^(8C) #^(8E) #^(91) - #^(9C) #^(9E) - #^(9F) #^(A1) - #^(FF) ] Printable: union Graphic charset reduce [SP #^(A0)] Integer^: Digits Decimal^: [Digits #. Digits] Pair^: [Digits #x Digits] Money^: [0 3 Alpha #$ Digits #. 2 Digit] Tag^: [# thru #] ; A Windows file name cannot contain any of these characters: Forbidden: charset {\/:*?|} Line_End: [newline | end] Blank_Line: [LWS? newline] Blank_Lines: [any Blank_Line] make object! [ Zone: [Sign^ 1 2 Digit #: 2 Digit] set 'Time^ [1 2 Digit #: 1 2 Digit opt [#: 1 2 Digit]] Long-Months: remove map Rebol/locale/Months func [Month [string!]] [ reduce ['| copy Month] ] Short-Months: remove map Rebol/locale/Months func [Month [string!]] [ reduce ['| copy/part Month 3] ] Month: [1 2 Digit | Long-Months | Short-Months] Separator: charset /- Day: [1 2 Digit] set 'Date^ [ [ [Day Separator Month Separator [4 Digit | 2 Digit]] | [4 Digit Separator Month Separator Day] ] opt [#/ [Time^ opt Zone]] ] ] make object! [ Permitted: exclude Printable Forbidden Filename: [some Permitted] Folder: [Filename #/] Relative_Path: [some Folder] Absolute_Path: [#/ any Relative_Path] set 'File^ [ [Absolute_Path opt Filename] | [Relative_Path opt Filename] | Filename ] ] make object! [ Permitted: exclude Printable Forbidden Drive^: [Alpha #:] Filename^: [some Permitted] Folder^: [Filename^ #\] Relative_Path^: [some Folder^] Absolute_Path^: [#\ any Relative_Path^] set 'Local_File^ [Drive^ Absolute_Path^ opt Filename^] ] make object! [ Char: union AlphaDigit charset -_~+*' Escape: [#% Hex Hex] Chars: [some [Char | Escape]] User: [some [Char | Escape | #.]] Domain-Label: Chars Domain: [Domain-Label any [#. Domain-Label]] IP-Address: [Digits #. Digits #. Digits #. Digits] Host: [Domain | IP-Address] set 'eMail^ [User #@ Host] Pass: Chars Port: [1 4 Digit] User-Pass-Host-Port: [ [User #: Pass #@ Host #: Port] | [User #: Pass #@ Host] | [User #: Host] | [Host #: Port] | [Host] ] Fragment: [## Chars] Query: [ #? [ any [opt # Chars #= [Chars | Absolute-Folder] | Chars | Absolute-Folder opt [#: Port]] ] ] Fragment_Or_Query: [Fragment | Query] Extension: [#. 1 4 Char] File: Chars Folder: [some [../ | ./ | [File opt [#. Chars] #/]]] set 'URI_Relative-Folder Relative-Folder: [ Folder opt File opt Extension opt Fragment_Or_Query | opt Folder File opt Extension opt Fragment_Or_Query | opt Folder opt File Extension opt Fragment_Or_Query | opt Folder opt File opt Extension Fragment_Or_Query ] set 'URI_Absolute-Folder Absolute-Folder: [#/ opt Relative-Folder] Net-Folder: [// User-Pass-Host-Port opt [Absolute-Folder]] Scheme: [Alpha some Char] set 'URL^ [Scheme #: Net-Folder] Local-File: [#% [Absolute-Folder | Relative-Folder]] set 'URI^ [eMail^ | URL^ | Local-File] ] ] -- To unsubscribe from
[REBOL] Another newbie VID question
Hi all ~ am wondering why my code below doesn't work toggle_start: toggle 60 Start [ flash we get here toggle_start/text: Stop show toggle_start ] What do I need to make a toggle switch between Start and Stop every time I press it? Where do I need to look to find which refinements a toggle has? Does it have a 'down' or 'pressed' ? TIA, Kai -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: Another newbie VID question
Hi Kai, Kai Peters wrote: Hi all ~ am wondering why my code below doesn't work toggle_start: toggle 60 Start [ flash we get here toggle_start/text: Stop show toggle_start ] What do I need to make a toggle switch between Start and Stop every time I press it? Where do I need to look to find which refinements a toggle has? Does it have a 'down' or 'pressed' ? This is the answer ... REBOL[] view layout [toggle_start: toggle 60 Start [ ;help face face/text: pick [Stop Start] face/data show face ] ] And here comes the explanation ... Those vid action blocks are turned into functions with the face itself as an argument, named face (be careful, sometimes it's only 'f, IIRC). Now, the commented out help face gave me a quick look at what the face contains, among a lot of other things, I found that there's face/data, a boolean value, so I decided that's it. your toggle_start/text: part was already ok (I just decided to use the word 'face, because it's shorter, and dag'n'droppable ;-) , now we just have to toggle the text depending on face/data (this feature of 'pick has been the source of many long and lively discussions, but it makes for nice short code). I hope that helps, Ingo -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: Another newbie VID question
Thanks for your very elaborate help, Ingo. It all makes good sense, yet there still is a problem: When I cut paste your code to my console, the toggle caption does not change on my machine?? Any ideas? Thanks, Kai -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: Another newbie VID question
Hi Kai, KP What do I need to make a toggle switch between Start and Stop KP every time I press it? How about: view layout [ toggle_start: toggle 60 Start Stop ] -- Gregg -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: Another newbie VID question
Kai Peters wrote: Thanks for your very elaborate help, Ingo. It all makes good sense, yet there still is a problem: When I cut paste your code to my console, the toggle caption does not change on my machine?? Any ideas? After some checks, yes, this has changed between the last official version (1.2.1) and my beta (1.2.8) use texts/1:!, like Sunanda said. Ingo -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Newbie VID question ctd.
The text part works fine, but another questions just popped up: Why does the face/color not get set to what I would expect, but black instead? Thanks again, Kai toggle_start: toggle 60 Start mint [ face/color: pick [yellow red] face/data face/texts/1: pick [Stop Start] face/data show face ] -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: Newbie VID question ctd.
Kai: Why does the face/color not get set to what I would expect, but black instead? toggle_start: toggle 60 Start mint [ face/color: pick [yellow red] face/data face/texts/1: pick [Stop Start] face/data show face ] 'yellow and 'red aren't being interpreted as RGB tuple numbers -- they are being seen as words in a block. Try this: unview/all view layout [ toggle_start: toggle 60 Start Stop mint [ face/color: pick reduce [to tuple! yellow to tuple! red] face/data show face ] ] (As Gregg has gently pointed out, the whole pick thing for the text is over-engineered. Just list the texts as part of the toggle -- as above). Sunanda. -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: Newbie VID question ctd.
Hi Kai, KP Why does the face/color not get set to what I would expect, but black instead? Because you're returning a word! from the block [yellow red], not a tuple! value. Just add a REDUCE and you're all set. view layout [ toggle-start: toggle 60 Start mint [ face/color: pick reduce [yellow red] face/data face/texts/1: pick [Stop Start]face/data show face ] ] It takes some getting used to when REBOL does, or doesn't, evaluate things, but if you get black where you expect a color you've used word for, that's almost always the cause. You can also just specify the colors directly, though it doesn't give you the untouched color (mint) as you have above: view layout [ toggle-start: toggle 60 Start Stop yellow red ] -- Gregg -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] edit-text
Hi Romano, I cany see this on your Rebsite Is the on a Web site? (this would be useful for my email client it would get tested every day!) Cheers Phil === Original Message === Other changes to my site. Among others things, i have added a patch for area and field: edit-text-undo.r which should fix area and field behaviour. It also and optional undo/redo and Esc key (to fields, like in Windows) Please, let me know if it does not work. --- Ciao Romano -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject. -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: url or file ?
is-url?: parse string[ thru :// to end] the basic idea is: is-url?: parse string[ copy protocol thru :// copy where-there to end] for specific protocols do without 'thru : is-http:? parse string[ http://; to end] eventually /all is not needed, but i always mess that up. -Volker Am Samstag, 4. Oktober 2003 20:40 schrieb [EMAIL PROTECTED]: Patrick: I came to the same solution but ... load fails with some value: ... And I have no idea how to workaround this easily. Load is not good if the values do not translate into REBOL words or datatypes. You may need to surround it with an error/try: s: recipes/0001.html loaded-s: form s error? try [loaded-s: load s] loaded-s is either now the original as a string, or the loaded values. Also, load can be dangerous if the string is untrusted. Try this: load rebol [quit] It'll exit your console. So you probably really need to use load/all. That returns a block, so your original code may need to become: s: recipes/0001.html loaded-s: form s error? try [loaded-s: first load/all s] Sunanda. -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.