with-file-caching-style (マクロ)
パッケージ: CURL.LANGUAGE.COMPILER

ファイルを開くときに、中のコードが継続する間 FileCachingStyle が使用されるように設定します。


例: FileCachingStyle の設定
{let web-page-source:Frame = {new Frame}}
{let button:CommandButton =
    {new CommandButton,
        label = "Choose location",
        {on Action do
            || open users choice of urls, bypassing
            || the cache to make sure that we get the latest
            || version of the web page.
            {if-non-null u = {choose-location} then
                let s:#StringBuf
                {with-file-caching-style FileCachingStyle.reload do
                    {with-open-streams t = {read-open u} do
                        || Load the whole page, caching really takes
                        || effect on opening, so this could be inside or
                        || outside the with-file-caching-style call.
                        set s = {t.read-one-string}
                    }
                }
                {web-page-source.clear}
                {web-page-source.add s}
            }
        }
    }
}
{HBox
    {text Reload a file or web page},
    button,
    web-page-source
}

注意事項

現在の FileCachingStyle は、この中に含まれるコード ブロックが終了すると復元されます。現在の FileCachingStyle は、ユーザー設定、エンジン設定、および現在のアプレットが再ロードされたかどうかによって異なります。