Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

determine bios setting

$
0
0
hello.

I am trying to determine the selected bios setting for SATA Emulation.  The selected option is determined by a *.  _arraysearch does not seem to support searching for that character.  So I loop through each value to see which one has the asteris.  This seems pretty inefficient - I'm sure there's a better way of doing this.

Thanks in advance =)

[ autoit ]         
#include <array.au3> $msg_normal = 0 $string = "SATA Emulation: *IDE,--,RAID,AHCI" $data = StringRegExp($string, "SATA Emulation: ([\S]*)", 3) Debug($data) $values = StringSplit($data[0], ",") If @error Then EndIf Debug($values) $index = _ArraySearch($values, "'*'") If @error Then EndIf Debug($index, @error) for $x = 1 to UBound($values)-1 if StringInStr($values[$x], "*") <> 0 Then $selected_option = StringReplace($values[$x], "*", "") EndIf Next Debug($selected_option) Func Debug($variable1 = "", $variable2 = "", $variable3 = "") If IsArray($variable1) Then _ArrayDisplay($variable1) Else If $variable2 <> "" Then $variable1 &= @CRLF & $variable2 EndIf If $variable3 <> "" Then $variable1 &= @CRLF & $variable3 EndIf ClipPut($variable1) MsgBox($msg_normal, "Debug", $variable1) EndIf EndFunc   ;==>Debug

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>