SelectedFilePattern()
语法
Result = SelectedFilePattern()概要
Returns the selected pattern index chosen with OpenFileRequester() or SaveFileRequester().
参数
无.
返回值
The selected pattern index chosen with OpenFileRequester() or SaveFileRequester(). The first pattern is at position 0.
示例
StandardFile$ = "C:\autoexec.bat" ; initial path + file Pattern$ = "Text (*.txt)|*.txt;*.bat|" ; set first pattern (index = 0) Pattern$ + "PureBasic (*.pb)|*.pb|" ; set second pattern (index = 1) Pattern$ + "Bmp (*.bmp)|*.bmp|" ; set third pattern (index = 2) Pattern$ + "Jpeg (*.jpg)|*.jpg|" ; set fourth pattern (index = 3) Pattern$ + "All files (*.*)|*.*" ; set fifth pattern (index = 4) Pattern = 1 ; use the second of the five possible patterns as standard ; Now we open a filerequester, you can change the pattern and will get the index after closing File$ = OpenFileRequester("Please choose file to load", StandardFile$, Pattern$, Pattern) Index = SelectedFilePattern() If Index > -1 MessageRequester("Information", "Following pattern index was selected: "+Str(Index), 0) Else MessageRequester("Information", "The requester was canceled.", 0) EndIf
已支持操作系统
所有