日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

释疑の语法LOCAL

發布時間:2025/3/20 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 释疑の语法LOCAL 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

作用就是把當前對象保存在一個臨時存儲空間,它只能用到子程序或者FUNTION MODULE里,在程序結束的時候數據對象重新分配在臨時空間的值。

如果用LOCAL對同一個對象執行了好幾遍,那么只有第一次執行起作用。

語法:LOCAL dobj.

The statement LOCAL (not allowed in classes) saves the current content of a data object dobj in an internal buffer. It can be used only in subroutines or function modules. At the end of the procedure, the data object dobj is reassigned to the value in the buffer. If LOCAL is executed in a procedure for a data object more than once, only the first execution is taken into account.

All data objects possible in write positions can be specified for dobj. If dobj is an internal table, the procedure should not be called within a LOOP loop that processes the table.

Modifiable formal parameters of the procedure, field symbols, or dereferenced data references are also possible after LOCAL. If formal parameters are specified, the assigned actual parameter is set to the value in the buffer at the end of the procedure. For field symbols, the field reference and the content of the referenced fields are saved.?

例子:

DATA?TEXT?TYPE?STRING?VALUE?'Global?text'.

CL_DEMO_OUTPUT=>WRITE_TEXT(?TEXT?).

PERFORM?SUBR1.

CL_DEMO_OUTPUT=>DISPLAY_TEXT(?TEXT?).

FORM?SUBR1.
??LOCAL?TEXT.
??TEXT?=?'Text?in?subr1'.
??CL_DEMO_OUTPUT=>WRITE_TEXT(?TEXT?).
??PERFORM?SUBR2?USING?TEXT.
??CL_DEMO_OUTPUT=>WRITE_TEXT(?TEXT?).
ENDFORM.

FORM?SUBR2?USING?PARA?TYPE?STRING.
??LOCAL?PARA.
??PARA?=?'Text?in?subr2'.
??CL_DEMO_OUTPUT=>WRITE_TEXT(?TEXT?).
ENDFORM.

輸出:



總結

以上是生活随笔為你收集整理的释疑の语法LOCAL的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。