Jump to content
  1. JScript

    JScript

  • Similar Content

    • By matwachich
      DEPRECATED: see this new UDF
       
    • By v0id
      I am starting out using AutoIt. Here is a simple form with username and password. I want to check if information entered is valid once user clicks a button.
      My problem now is that it only validates once. E.g.: if I type 5 character username, it will complain it is not 7 character (good). But once I correct that mistake and press the button again it will still say the same thing.
      Do I need to have a loop?
       
      #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <MsgBoxConstants.au3> Opt("GUIOnEventMode", 1) $main = GUICreate("Test Tool", 600, 600) $hyourlabel = GUICtrlCreateLabel("YOUR CREDENTIALS", 30, 10, 256) GUICtrlSetFont($hyourlabel, Default, 600) Local $adminfrejalabel = GUICtrlCreateLabel("Username:", 8, 38, 64, 17) Global $adminfrejaid = GUICtrlCreateInput("", 80, 38, 110, 17) Local $adminpasswordlabel = GUICtrlCreateLabel("Password:", 8, 62, 64, 17) Global $adminpassword = GUICtrlCreateInput("", 80, 62, 110, 17, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL)) $userButton_Check = GUICtrlCreateButton("VALIDATE", 32, 480, 85, 25) GUICtrlSetOnEvent($userButton_Check, "startvalidation") GUISetOnEvent($GUI_EVENT_CLOSE, "ExitGUI") GUISetState(@SW_SHOW) While 1 Sleep(10) WEnd Func startvalidation() ;CHECK VALIDATIONS $adminfrejaid = GUICtrlRead($adminfrejaid) $adminpassword = GUICtrlRead($adminpassword) If StringLen($adminfrejaid) <> '7' Then MsgBox($MB_SYSTEMMODAL, "User ID", "Please enter exactly 7 characters.") ;Exit EndIf If StringLen($adminpassword) < '5' Then MsgBox($MB_SYSTEMMODAL, "Your Password", "Please enter a valid password.") ;Exit EndIf EndFunc Func ExitGui () Exit ; Exit the program EndFunc  
    • By Dwalfware
      Does anyone know how to find IPv6 expression. 
      I have Ipv4 but with IPv6 the address is never strait, some times you have 5 ":"  some times you have 7?
      Local $aISITIPv4 = StringRegExp("192.168.0.1", "[0-9]{1,3}+\.[0-9]{1,3}+\.[0-9]{1,3}+\.[0-9]{1,3}", 0) any ideas how to code for below? Lost   Point in right direction or tip please. Begging 
      2001:4860:4860::8888 2001:4860:4860::8844 2620:0:ccc::2 2620:0:ccd::2 2a02:6b8::feed:0ff 2a02:6b8:0:1::feed:0ff 2001:67c:28a4:: 2002:d596:2a92:1:71:53:: 2001:470:6c:521::2 2001:470:6d:521::1 2001:1608:10:25::1c04:b12f 2001:1608:10:25::9249:d69b 2001:910:800::12 2001:910:800::40 2606:4700:4700::1111 2606:4700:4700::1001 2610:a1:1018::1 2610:a1:1019::1 2610:a1:1018::5 2610:a1:1019::5 2a00:5a60::ad1:0ff 2a00:5a60::ad2:0ff 2a02:6b8::feed:a11 2a02:6b8:0:1::feed:a11 2a0d:2a00:1:: 2a0d:2a00:2:: 2a0d:2a00:1::1 2a0d:2a00:2::1 2610:a1:1018::3 2610:a1:1019::3 2610:a1:1018::4 2610:a1:1019::4 2a00:5a60::bad1:0ff 2a00:5a60::bad2:0ff 2a02:6b8::feed:bad 2a02:6b8:0:1::feed:bad 2a0d:2a00:1::2 2a0d:2a00:2::2 2610:a1:1018::2 2610:a1:1019::2  
    • By Dwalfware
      HI
      Another head scratched
      Anyone solve how to get the IPV6 from WMI?
      I followed the usual SELECT * FROM Win32_NetworkAdapter WHERE NetConnectionID='" & GUICtrlRead($cboAdapters) & "'
      get the index 
      port it to 
      Local $query = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE Index = " & _GetSelectedNIC(), "WQL", 0x30 )
      All i can see is IPv4 addresses
      My question is is there another place the IPv6 information is hiding? I configured my LAN with IPV6 and my wireless with IPv4 so I can see what shows.
      Thanks in Advance.
      PS. I did try google
       
    • By ahha
      I'm using the excellent _Excel UDF to read a whole spreadsheet into an array I want to operate on.  I can read a specified range without a problem.  What I'd like to do is allow the user in Excel to select a range (contiguous is fine) and be able to read that range so that I know what range to operate on without having the user input the range via a keyboard.  I'm stuck and any hints greatly appreciated.  The code below uses the Helpfile .xls to illustrate where I crash.
      ; #AutoIt3Wrapper_run_debug_mode=Y ; use this to debug in console window <--- LOOK #include <Excel.au3> #include <MsgBoxConstants.au3> #include <Debug.au3> ;for _DebugArrayDisplay $sExcelFullFileName = "C:\Program Files (x86)\AutoIt3\Examples\Helpfile\Extras\_Excel1.xls" ;use Autoit test for example $oExcel = _Excel_Open() ;Create application object and open an Excel workbook $oWorkbook = _Excel_BookOpen($oExcel, $sExcelFullFileName) $aExcelArray = _Excel_RangeRead($oWorkbook, Default) _DebugArrayDisplay($aExcelArray, $aExcelArray) ;let's look at it $aI5K6 = _Excel_RangeRead($oWorkbook, Default,"I5:K6") ;read a rangeI5:K6 and return value _DebugArrayDisplay($aI5K6, $aI5K6) ;let's look at range it ;rather than defining the range explicity I'd like to read the selection in Excel and use it ;need a function like _Excel_SelectionRead ;try hacking Excel.au3 _Excel_RangeRead to see if can create _Excel_SelectionRead looks like .Selection .Value .Text and .Address possible MsgBox($MB_SYSTEMMODAL, "Info", "Select cells in Excel then click OK") ;ACTUALLY get range of the selection and this will suffice for us to use on the $aExcelArray $vRange = $oWorkbook.ActiveSheet.Selection.Address($vRange) ;tried all sorts of permutations and clearly I need help _DebugArrayDisplay($vRange, $vRange) ;let's look at range it ;$vResult = $oExcel.Transpose($vRange.Value) ;_DebugArrayDisplay($vResult, $vResult) ;let's look at range it _Excel_Close($oExcel, False, True) Exit  
×
×
  • Create New...