跳转到内容

Rebol 编程/load-stock

来自维基教科书,自由的教科书
LOAD-STOCK name /block size 

加载并返回库存图片。(第一次加载后保留缓存)

LOAD-STOCK 是一个函数值。

  • 名称 -- (类型:任何)
  • /block
    • 尺寸 -- (类型:任何)

源代码

[编辑 | 编辑源代码]
load-stock: func [
    {Load and return stock image. (Keep cache after first load)} 
    name 
    /block size 
    /local image
][
    if not image: find system/view/vid/image-stock name [
        make error! reform ["Image not in stock:" name]
    ] 
    either block [
        block: copy [] 
        loop size [
            if not image? second image [change next image load second image] 
            append block second image 
            image: skip image 3
        ] 
        return block
    ] [
        if not image? second image [change next image load second image] 
        return second image
    ]
]
华夏公益教科书