Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/28/2017 in all areas

  1. Try using FileOpen with the append before writing second array $sFilePath = "Path to your file" FileOpen($sFilePath, $FO_APPEND) _FileWriteFromArray(Your options Here)
    1 point
  2. UEZ

    To take between hyphens?

    #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 741, 318) $sString = "DE536F150981EE9-843246755A584A645957686A5A58526C634756415A3231686157777559323973-6304D0584A4C0CB072A2E120A4ADBCB6" $Input1 = GUICtrlCreateInput($sString, 74, 48, 649, 21) $Input2 = GUICtrlCreateInput("",74, 88, 649, 21) $Input3 = GUICtrlCreateInput("",74, 128, 649, 21) $Button1 = GUICtrlCreateButton("Button1", 288, 264, 75, 25) GUISetState(@SW_SHOW) $aResult = StringRegExp($sString, "([[:xdigit:]]+)-([[:xdigit:]]+)-([[:xdigit:]]+)", 3) GUICtrlSetData($Input2, $aResult[1]) GUICtrlSetData($Input3, $aResult[2]) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $aReadinput1 = GUICtrlRead($Input1) ;I want to delete 15 characters here : --> DE536F150981EE9- ;GUICtrlSetData($Input2,"843246755A584A645957686A5A58526C634756415A3231686157777559323973") ;GUICtrlSetData($Input3,"6304D0584A4C0CB072A2E120A4ADBCB6") EndSwitch WEnd Or #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 741, 318) $sString = "DE536F150981EE9-843246755A584A645957686A5A58526C634756415A3231686157777559323973-6304D0584A4C0CB072A2E120A4ADBCB6" $Input1 = GUICtrlCreateInput($sString, 74, 48, 649, 21) $Input2 = GUICtrlCreateInput("",74, 88, 649, 21) $Input3 = GUICtrlCreateInput("",74, 128, 649, 21) $Button1 = GUICtrlCreateButton("Button1", 288, 264, 75, 25) GUISetState(@SW_SHOW) $iPosL = StringInStr($sString, "-") $iPosR = StringInStr($sString, "-", 0, -1) GUICtrlSetData($Input2, StringMid($sString, $iPosL + 1, $iPosR - $iPosL - 1)) GUICtrlSetData($Input3, StringMid($sString, $iPosR + 1, StringLen($sString) - $iPosR)) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $aReadinput1 = GUICtrlRead($Input1) ;I want to delete 15 characters here : --> DE536F150981EE9- ;GUICtrlSetData($Input2,"843246755A584A645957686A5A58526C634756415A3231686157777559323973") ;GUICtrlSetData($Input3,"6304D0584A4C0CB072A2E120A4ADBCB6") EndSwitch WEnd
    1 point
  3. using just stringinstr and stringmid $str = "DE536F150981EE9-843246755A584A645957686A5A58526C634756415A3231686157777559323973-6304D0584A4C0CB072A2E120A4ADBCB6" consolewrite(stringmid($str , stringinstr($str , "-" , 0 , 1) + 1 , (stringinstr($str , "-" , 0 , 2) - stringinstr($str , "-" , 0 , 1) - 1)) & @CR & stringmid($str , stringinstr($str , "-" , 0 , -1) + 1) & @CR)
    1 point
  4. Simpel

    To take between hyphens?

    Try (untested): GUICtrlSetData($Input2, $aSplit[2]) GUICtrlSetData($Input3, $aSplit[3]) And delete the for-next-loop. Conrad
    1 point
  5. You obviously didn't look that hard, then, as there are a half-dozen ways documented in the help file to accomplish this. Try this and see what you get: #include <Array.au3> Local $sString = "DE536F150981EE9-843246755A584A645957686A5A58526C634756415A3231686157777559323973-6304D0584A4C0CB072A2E120A4ADBCB6" Local $aSplit = StringSplit($sString, "-") _ArrayDisplay($aSplit) ;=======OR======= MsgBox(0, "StringMid Example", StringMid($sString, 16)) ;skip 15 chars ;=======OR======= MsgBox(0, "StringTrimLeft Example", StringTrimLeft($sString, 15)) ;=======OR======= MsgBox(0, "StringRight Example", StringRight($sString, (StringLen($sString) - 15)))
    1 point
  6. Sure, just open 2 browser windows, type both messages and click OK more or less at the same time. Other than that, we don't want and automated posting discussions here. Jos
    1 point
  7. _ArrayUnique ( Const ByRef $aArray [, $iColumn = 0 [, $iBase = 0 [, $iCase = 0 [, $iCount = $ARRAYUNIQUE_COUNT [, $iIntType = $ARRAYUNIQUE_AUTO]]]]] ) see how the first parameter doesnt have an equal sign, that one is required, that is the array you specify. the others are preset for all intents and purposes so you are really sending _ArrayUnique($aArray, 0, 0, 0, $ARRAYUNIQUE_COUNT , $ARRAYUNIQUE_AUTO) you want $ARRAYUNIQUE_NOCOUNT.
    1 point
  8. As I stated in your other array-related thread: The help file is your friend!
    1 point
  9. water

    _ArrayAdd()

    Reading the help file helps: What you are looking for is
    1 point
  10. Help File for _ArrayUnique
    1 point
  11. Hi. I don't know exactly what you try. I guess you want to try these: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 800, 217) $Input1 = GUICtrlCreateInput("Input1@hotmail.com", 74, 48, 649, 21);E-mail entry $Input3 = GUICtrlCreateInput("Input1@hotmail.c", 344, 128, 377, 21);E-mail Verification $Input4 = GUICtrlCreateInput("asdf", 74, 160, 649, 21);$Input3Control = "asdf" $Button1 = GUICtrlCreateButton("Button1", 74, 184, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $Input3Control = "asdf" $aReadMail = GUICtrlRead($Input1) $aRegex = StringRegExp($aReadMail, '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$', 3) $inputcontrol3 = GUICtrlRead($Input3) $inputcontrol4 = GUICtrlRead($Input4) Select Case Not IsArray($aRegex) MsgBox(48,"Error","This is not an email!",5) Case GUICtrlRead($input1) = "" MsgBox(48, "Error - Missing Field", "Please enter an email address") Case GUICtrlRead($Input3) <> GUICtrlRead($Input1) MsgBox(48, "Error - Missing Field", "Email address and verification don't match") Case GUICtrlRead($Input4) = "" MsgBox(48, "Error - Missing Field", "Please enter text") Case GUICtrlRead($Input4) <> $inputcontrol3 MsgBox(48, "Error - Missing Field", "Entries are not the same") Case Else MsgBox(64,"Ok","No Problem",5) EndSelect EndSwitch WEnd First you want to check if email adress is correct so have should do it the first case. (Because cases will be done from top to bottom. If one case matches no further conditions will be tested.) And at the last case you typed '$Input3Control' but it is not existing. You meant '$inputcontrol3'? Regards, Conrad
    1 point
×
×
  • Create New...