書籤
分類
-
近期文章
近期迴響
彙整
- 2025 年 五月
- 2025 年 三月
- 2025 年 二月
- 2025 年 一月
- 2024 年 十二月
- 2024 年 十一月
- 2024 年 十月
- 2024 年 九月
- 2024 年 八月
- 2024 年 七月
- 2024 年 六月
- 2024 年 五月
- 2024 年 四月
- 2024 年 三月
- 2024 年 二月
- 2024 年 一月
- 2023 年 十二月
- 2023 年 十一月
- 2023 年 十月
- 2023 年 九月
- 2023 年 八月
- 2023 年 七月
- 2023 年 六月
- 2023 年 五月
- 2023 年 四月
- 2023 年 三月
- 2023 年 二月
- 2023 年 一月
- 2022 年 十二月
- 2022 年 十一月
- 2022 年 十月
- 2022 年 九月
- 2022 年 八月
- 2022 年 七月
- 2022 年 六月
- 2022 年 五月
- 2022 年 四月
- 2022 年 三月
- 2022 年 二月
- 2022 年 一月
- 2021 年 十二月
- 2021 年 十一月
- 2021 年 十月
- 2021 年 九月
- 2021 年 八月
- 2021 年 七月
- 2021 年 六月
- 2021 年 五月
- 2021 年 四月
- 2021 年 三月
- 2021 年 二月
- 2021 年 一月
- 2020 年 十二月
- 2020 年 十一月
- 2020 年 十月
- 2020 年 九月
- 2020 年 八月
- 2020 年 七月
- 2020 年 六月
- 2020 年 五月
- 2020 年 四月
- 2020 年 三月
- 2020 年 二月
- 2020 年 一月
- 2019 年 十二月
- 2019 年 十一月
- 2019 年 十月
- 2019 年 九月
- 2019 年 八月
- 2019 年 七月
- 2019 年 六月
- 2019 年 五月
- 2019 年 四月
- 2019 年 三月
- 2019 年 二月
- 2019 年 一月
- 2018 年 十二月
- 2018 年 十一月
- 2018 年 十月
- 2018 年 九月
- 2018 年 八月
其它
[vb] Excel VBA 程式設計教學:陣列(Array)
參考網址:https://blog.gtwang.org/programming/excel-vba-array/
動態陣列
一般的陣列在宣告時就必須決定好陣列的大小,但是有的時候我們無法事先預知程式所需要的陣列大小,要等到實際執行時才會知道需要多少空間,這時候就可以使用動態陣列的方式來儲存資料。
動態陣列(dynamic arrays)的特點就是可以動態改變陣列的大小,在空間不足時可以擴增,而空間太大時也可以縮減,以下是動態陣列的使用方式:
' 宣告動態陣列 Dim MyDynArr() As Integer ' 調整陣列大小 ReDim MyDynArr(3) MsgBox "LBound = " & LBound(MyDynArr) _ & ", Ubound = " & UBound(MyDynArr) MyDynArr(3) = 123
動態陣列的宣告方式就是在宣告陣列時不要指定索引範圍,然後在要使用陣列之前執行 ReDim
設定陣列的大小。
隨後如果需要改變動態陣列的大小,也是同樣呼叫 ReDim
並指定新的陣列大小,而在預設的狀況下使用 ReDim
改病陣列大小時,原本儲存於陣列中的資料會被刪除,如果想要保留舊資料,就要加上 Preserve
,如果舊資料不需要保留的話,就可以將 Preserve
省略,這樣執行速度會比較快。
' 調整陣列大小,保留陣列內部資料 ReDim Preserve MyDynArr(10) MsgBox "LBound = " & LBound(MyDynArr) _ & ", Ubound = " & UBound(MyDynArr) MyDynArr(7) = 456 MsgBox MyDynArr(3) MsgBox MyDynArr(7)
這裡的 LBound
與 UBound
是用來查詢陣列索引下限與上限的函數。
當動態陣列使用完畢之後,我們可以使用 Erase
將系統配置給動態陣列的記憶體收回:
Erase MyDynArr
Erase
若用於一般性的陣列,則會將陣列內的每個元素重新初始化。
[VB]將文字寫入或讀出文字檔案(VB .NET)
參考網址:程式設計者之春
以下程式碼範例示範將文字寫入文字檔案的簡易方法。
Imports System Imports System.IO Class Test Public Shared Sub Main() ' Create an instance of StreamWriter to write text to a file. Dim sw As StreamWriter = New StreamWriter("TestFile.txt") ' Add some text to the file. sw.Write("This is the ") sw.WriteLine("header for the file.") sw.WriteLine("-------------------") ' Arbitrary objects can also be written to the file. sw.Write("The date is: ") sw.WriteLine(DateTime.Now) sw.Close() End Sub End Class
以下程式碼範例示範從文字檔案讀取文字的簡易方法。
Imports System Imports System.IO Class Test Public Shared Sub Main() Try ' Create an instance of StreamReader to read from a file. Dim sr As StreamReader = New StreamReader("TestFile.txt") Dim line As String ' Read and display the lines from the file until the end ' of the file is reached. Do line = sr.ReadLine() Console.WriteLine(Line) Loop Until line Is Nothing sr.Close() Catch E As Exception ' Let the user know what went wrong. Console.WriteLine("The file could not be read:") Console.WriteLine(E.Message) End Try End Sub End Class
雙敗淘汰圖形產生器
※ 儲存的SVG圖檔可以直接給 LibreOffice 使用,MS Office 則要 2016 版之後才支援 SVG 圖片格式。
[sport]混合運動計分表
參考網址:http://www.sport.mlc.edu.tw/docs/multievents/
搜尋關鍵字combined events scoring tables
http://www.sport.mlc.edu.tw/docs/multievents/combinedEventsScoring.htm
http://www.sport.mlc.edu.tw/docs/multievents/
http://www.sport.mlc.edu.tw/docs/multievents/functions.js
IAAF Scoring Tables for Combined Events Tables de Cotation …
http://legacy.usatf.org/statistics/calculators/combinedEventsScoring/
[firefox] standlone install 離線安裝版下載
[php]php測試執行時間
<?php /** * 測試php執行時間 */ function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } $time_start = microtime_float(); //休息一下或程式碼放這裡 usleep(100); $time_end = microtime_float(); $time = $time_end - $time_start; echo "執行時間".$time.'秒<br />';
筆電教學-ACER Win10 筆電,如何進BIOS;如何設定FN鍵;
參考網址: 藤小二 https://www.youtube.com/watch?v=U4OGPtKBAF4
完整關機 shift+關機
進入BIOS Fn+F2 按著 再按電源鍵
修改function key behavior 模式
media模式:F1..F12
function模式 : Fn+F1..F12
還原進入鍵
Fn + Alt + F10 + 電源鍵