﻿﻿ 按键精灵的子程序（Sub）和函数（Function） | 信义之树

# 按键精灵的子程序（Sub）和函数（Function）

2018年02月13日 星期二 15:46:15 按键精灵 9,714 次 0

```x = 1
y = 2
TracePrint "主脚本中，实参x=："&x
TracePrint "主脚本中，实参y=：" & y
call 交换变量的值(x, y)
Sub 交换变量的值(a, b)
z = a
a = b
b = z
TracePrint "交换后形参a=："&a
TracePrint "交换后形参b=："&b
TracePrint "交换后变量z=："&z
TracePrint "交换后实参x=："&x
TracePrint "交换后实参y=："&y
End Sub
```

```第3行：主脚本中，实参x=：1

```

```c=加法(1,2)
TracePrint c
Function 加法(a, b)
加法=a+b
End Function
```

```第2行：3
```
{"ft_lang_label":"__label__zh","ft_lang_prob":0.76210576,"math_prob":0.99502194,"size":507,"snap":"2023-40-2023-50","text_gpt3_token_len":353,"char_repetition_ratio":0.22067595,"word_repetition_ratio":0.0,"special_character_ratio":0.3708087,"punctuation_ratio":0.03960396,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.95431393,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-12-07T16:17:35Z\",\"WARC-Record-ID\":\"<urn:uuid:e4324dd5-2722-4c16-9c24-cae8adc8b2b0>\",\"Content-Length\":\"20292\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:0a904743-2771-4a82-bed9-95644d279e37>\",\"WARC-Concurrent-To\":\"<urn:uuid:eb149ab7-c35b-4a9f-924c-ad357f782677>\",\"WARC-IP-Address\":\"43.139.30.105\",\"WARC-Target-URI\":\"http://www.xinyizhishu.top/186.html\",\"WARC-Payload-Digest\":\"sha1:6WOP3GTY4I3CEFB77VUPQRED4WGINYXE\",\"WARC-Block-Digest\":\"sha1:GMWIOMG3NILRTSZ4U2YUIPRJTUBSTQ7K\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100677.45_warc_CC-MAIN-20231207153748-20231207183748-00364.warc.gz\"}"}