[REBOL] Odd results Re:(4)
[EMAIL PROTECTED] wrote: Hello [EMAIL PROTECTED]! VID is a dialect; the syntax is not the same as that of "normal" REBOL code. It allows you to execute code to calculate parameters for styles, but it is made to layout styles, not to execute REBOL code. The function LAYOUT interprets the block you are passing to it in its own way; you can't expect it to execute it as it was a code block, because it isn't: LAYOUT has its own interpreter (wich you can see with SOURCE LAYOUT if you want). Okay, thanks for putting it that way. I can understand that. Now what I would like to know is why if the VID dialect is not able to handle a particular issue is it not passed back up the tree to the root interpreter? That would be the ideal situation so one could then mix/match /core and VID syntax at any time and place (see also PERL, ARexx, etc..). Regards, Deryk
[REBOL] Odd results
'lo gang. Here is a wierd one which has me stumped. Why will the following not work? REBOL [ Title: "InformeR" File: %informer.r Author: "Deryk Robosson" Email: [EMAIL PROTECTED] Date: 04-Jul-2000 Purpose: { A simple menthod for providing simple requesters } ] image-path: http://www.google.com/images/Title_Paint.gif inform-error: func [ {Displays an error requester} ttext [series!] {Title text} itext [series!] {Text to be displayed} gatext [series!] {Gadget Text} /local error-img ][ inform layout [ subtitle ttext across image image-path text itext 'return button gatext [hide-popup] ] ] view layout [ inform-error "Title Text" "This is some error text." "Okay" ] results in: Unknown word or style: inform-error Misplaced item: "Title " Misplaced item: "This i" Misplaced item: "Okay" The window opens but nothing is displayed. I'm still baffled as to why one cannot just mix and match /view and /core at any time and place. Regards, Deryk
[REBOL] Odd results Re:(2)
[EMAIL PROTECTED] wrote: Hi Deryk, One of the reasons you are getting errors is that an 'inform dialog cannot be shown as the first/only face. But as below shows you can re-use you dialog as much as you like after it has a parent face. Yup, okay, I can understand that (don't know why, but can comprehend..) ; this works view layout [ button "this" [inform-error "Title Text" "This is some error text." "Okay"] button "that" [inform-error "Title Text" "You pressed 'that button." "Okay"] ] Yup, so it does. Another thing to remember, 'Layout is for creating a 'face using VID or VID styles. If you look at your layout. You can see that you are not providing a style in your layout block. Hence the unrecognised style errors in... Yup, thought (and noticed the style bit) about that also. But, as you notice, inform-error is a function which should "in theory" be able to be called and executed from within the view layout [] context. It appears to me that the parser is pulling out the pieces it wants and disregarding the rest for the most part as unneeded. If we do: view layout [ button "Howdy Gang!" [print "Rebol is cool"] button "Quit" [quit] inform-error "Title Text" "This is some error text." "Okay" ] We still will not get the inform-error function called which really was the part that confused me the most as the parser (interpreter) perceives this as a 'style. Deryk