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

Bug in LAYOUT with VAL

 [1/4] from: larry::ecotope::com at: 28-Apr-2001 17:04


Hi all While checking to see if a script was overwriting any global words, I found the LAYOUT function is using the word VAL in the global context. From the View Console (Win98) on a fresh start without running the desktop and without any user code in user.r:
>> val
== "imanXwin kludge" ; hmm...
>> val: 23
== 23
>> layout [box "hello"] >> val
== "hello" So if I define the word VAL, the value will be wiped whenever the LAYOUT function is called. Probably best to avoid using the word VAL until this is fixed. It is interesting to note that the word VAL is defined as a local in the layout function, but it leaks out from somewhere when layout is called. -Larry

 [2/4] from: ptretter:norcom2000 at: 28-Apr-2001 20:08


Thats good information. We may need a patch or something in the meantime to prevent that for those of us that bought /Pro. Paul Tretter ----- Original Message ----- From: "Larry Palmiter" <[larry--ecotope--com]> To: <[rebol-list--rebol--com]> Cc: <[feedback--rebol--com]>

 [3/4] from: larry::ecotope::com at: 29-Apr-2001 17:06

Re: Bug in LAYOUT with VAL helpdesk #6211


Hi All I found the bug.
>> protect 'val >> layout [box "hello"]
** Script Error: Word val is protected, cannot modify ** Where: forall ** Near: val: first args switch/default type?/word
>>
LAYOUT calls several other VID functions and the code above is in a function called GROW-FACETS, which is called by LAYOUT. The word VAL should have been declared local to GROW-FACETS, but was not. Until it gets fixed, I devised a quick patch for GROW-FACETS. You can get it at: http://www.nwlink.com/~ecotope1/reb/grow-facets-patch.r Put the script in the same directory as your user.r file and add this line do %grow-facets-patch.r to your user.r file. The more advanced REBOLS out there may enjoy figuring out how the patch works. Cheers -Larry ----- Original Message ----- From: "Larry Palmiter" <[larry--ecotope--com]> To: <[rebol-list--rebol--com]> Cc: <[feedback--rebol--com]>

 [4/4] from: larry:ecotope at: 29-Apr-2001 23:25


Replying to my own post. I found a much more elegant, although obscure fix for this bug, that does not require downloading a script. Put the following line of code in your user.r. Note: svv is a built-in short-cut for system/view/vid. svv/grow-facets: func append third get in svv 'grow-facets [val] second get in svv 'grow-facets -Larry