2020年2月7日金曜日

FileMaker 18|While関数のデバッグ・While関数を途中で止める

While関数のデバッグ・While関数を途中で止める


FileMaker 18
要プラグイン
ScriptMakerPS | FileMaker Plugin for Windows
FileMakerのフィールドに記述した「PowerShell」を実行し、戻り値を取得。
https://sites.google.com/site/scriptmakerps/


While関数で、途中の値をダイアログで確認。

While (
    [
        count = 0 ;
        total = 0 ;
        $a[1] = 25 ;
        $a[2] = 50 ;
        $a[3] = 75
    ] ;
    count < 3 ;
    [
        count = count + 1 ;
        total = total + $a[count];


        $$Value=List(count;total);
        $$ER=SMPS_ExecSync( "[System.Windows.MessageBox]::Show('" & $$Value & "')" )


    ] ;
    total
)



確認する値が、文字列で ' (シングルクォーテーション)を含む場合
While (
    [
        count = 0 ;
        total = 0 ;
        $a[1] = "ABC" ;
        $a[2] = "あいうえお" ;
        $a[3] = "'カキクケコ'"
    ] ;
    count < 3 ;
    [
        count = count + 1 ;
        total =List( total ; $a[count]);


        $$Value=List(count;Substitute ( total; "'" ; "''" )  );
        $$ER=SMPS_ExecSync( "[System.Windows.MessageBox]::Show('" & $$Value & "')" )


    ] ;
    total
)



While関数を途中で止める
While (
    [
        $$ER="";
        count = 0 ;
        total = 0 ;
        $a[1] = 25 ;
        $a[2] = 50 ;
        $a[3] = 75
    ] ;
    count < 3   and  $$ER ≠ "No";
    [
        count = count + 1 ;
        total = total + $a[count];


        $$Value=List(count;Substitute ( total; "'" ; "''" )  );
        $$ER=SMPS_ExecSync( "[System.Windows.MessageBox]::Show('" & $$Value & "', '' , 'YesNo')" )


    ] ;
    total
)


0 件のコメント:

コメントを投稿