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

VID begniner

 [1/7] from: brahim::el-idrissi::wanadoo::fr at: 14-Sep-2002 21:28


Hi, I m a beginning rebol developpement. using "repeat i 10" inside "view layout" block leds to this error : Unknown word or style: repeat Unknown word or style: i can someone help me please. thanks,

 [2/7] from: gscottjones:mchsi at: 14-Sep-2002 18:02


From: "Brahim"
> I m a beginning rebol developpement. > using "repeat i 10" inside "view layout" block leds to this error : > Unknown word or style: repeat > Unknown word or style: i > > can someone help me please. > thanks,
Hi, Brahim, Welcome to VID ("Video Interface Dialect"). Probably the single most helpful thing that I can do is stress that VID is a dialect that controls the view graphics. While dialects may share words in common with REBOL, these words are independently defined for the sole purpose of the dialect, and may not reflect the same usage as REBOL. And by extension of this concept, words used in REBOL may not be defined at all in a dialect. You can think of a dialect as a separate mini-language that typically has a very special purpose. You have discovered that the word repeat and the variable index i are not defined in VID. I do not know what end goal you were seeking in the use of the repeat statement. If you were trying to repeat a structure in a layout, you can set up a block as follows: blk: copy [] repeat i 10 [append append blk 'button to-string i ] view layout blk In this case the repeat word is not in the block to be parsed by the dialect rules. You may use virtually any REBOL word in the action blocks. For example: view layout [button "Print 10" [repeat i 10 [print i]]] You may wish to check out the rebol.com documentation pages for further information on words that make up the VID dialect. Of course, you are welcome to ask further questions on the list. Hope this helps. --Scott Jones

 [3/7] from: dockimbel:free at: 15-Sep-2002 1:15


Hi Brahim, 'repeat is not a valid VID keyword or style, that's why you're getting this error. Show us the VID source code, so we can see what you're wanting to achieve. HTH, -DocKimbel. Brahim wrote:

 [4/7] from: gchiu:compkarori at: 15-Sep-2002 11:40


On Sat, 14 Sep 2002 21:28:09 +0200 "Brahim" <[brahim--el-idrissi--wanadoo--fr]> wrote:
>I m a beginning rebol developpement. >using "repeat i 10" inside "view layout" block leds to >this error : > Unknown word or style: repeat >Unknown word or style: i > >can someone help me please.
Hi, VID stand for Visual Inteface Dialect. So, the block that is passed to 'layout and thence to 'view, comprises words that are a special dialect that is interpreted by 'view. These words are not Rebol words hence the error. If you wish to run some Rebol code inside the block before it is passed to the View interpreter, you need to do something like: view layout compose [ vid words ( some rebol code here ... ) more vid words ] eg: view layout compose [ vh1 ( join "Testing " 1 + 2 ) ] -- Graham Chiu

 [5/7] from: gscottjones:mchsi at: 14-Sep-2002 18:55


From: "G. Scott Jones"
> Welcome to VID ("Video Interface Dialect").
Whoops, just caught my error after reading Graham's response. Blush. I guess I should go read the documentation! :-) --Scott Jones

 [6/7] from: carl:s:rebol at: 14-Sep-2002 15:43


Hi Brahim, Since I happen to be right here, and it sounds like you need a bit of information, and I do know a couple things about the subject... maybe I can help. When you write VIEW LAYOUT [...] you are telling REBOL to build a layout from a dialect of REBOL (called VID), not REBOL itself. A dialect is a variation of REBOL that is a lot more powerful at expressing ideas, but within a specific domain (graphics in this case). So, the block that you pass to LAYOUT is not regular REBOL. If you want to use regular REBOL within it, you'll can put it in parens ( ) to be safe. (It's not always required, but that's the safest way.) view layout [text bold (reform ["The time is now: " now/time])] If you want to use a repeat, let's say for repeating a bunch of buttons, it would be better to do that first as a block, then pass that block to LAYOUT. Here's an example: block: [H2 "My Example!"] repeat i 10 [append block [button form i]] probe block view layout block Now, you've created a window that has ten numbered buttons. Hope that helps. Have fun! -Carl At 9/14/02 09:28 PM +0200, you wrote:

 [7/7] from: carl:s:rebol at: 14-Sep-2002 16:13


Hi again Brahim, Even us old guys make mistakes, here's a correction to what I gave you: block: [H2 "My Example!"] repeat i 10 [repend block ['button form i]] probe block view layout block The REPEND is short for APPEND REDUCE. It will produce: [button "1"], etc. Serves me right for not running it. But then, I never run my code, just publish it. ;) -Carl