函数和循环
Functions and loops
我正在尝试使函数 _EncryptionProcess()
逐一获取数组并处理它们。我意识到你不能在 For
循环中使用函数。
需要取数组的位置就是输入$aArray
的地方,数组就存放在这个值中。另一个变量定义密钥大小和值。
;Cuts the input up into piece;
$VariableToBeCut = "12345678"
$aArray = StringRegExp($VariableToBeCut, ".{2}", 3)
MsgBox(0, "die", $aArray[0]) ; personal check to make sure array works
$DataToBeEncrypted=_EncryptionProcess($aArray, $keyvalue, $keysize, 1) ;$aArray needs to be where the different arrays are processed
MsgBox(0, "Encrypted data", $DataToBeEncrypted)
这就是您应该如何处理数组元素。
;Cuts the input up into piece;
$VariableToBeCut = "12345678"
$aArray = StringRegExp($VariableToBeCut, ".{2}", 3)
ConsoleWrite("Array element 0: " & $aArray[0] & @LF) ; personal check to make sure array works
For $i = 0 To UBound($aArray)-1
$DataToBeEncrypted = _EncryptionProcess($aArray[$i], $keyvalue, $keysize, 1)
ConsoleWrite("Element " & $i & " : " & $aArray[$i] & " DataToBeEncrypted: " & $DataToBeEncrypted & @LF)
Next
我正在尝试使函数 _EncryptionProcess()
逐一获取数组并处理它们。我意识到你不能在 For
循环中使用函数。
需要取数组的位置就是输入$aArray
的地方,数组就存放在这个值中。另一个变量定义密钥大小和值。
;Cuts the input up into piece;
$VariableToBeCut = "12345678"
$aArray = StringRegExp($VariableToBeCut, ".{2}", 3)
MsgBox(0, "die", $aArray[0]) ; personal check to make sure array works
$DataToBeEncrypted=_EncryptionProcess($aArray, $keyvalue, $keysize, 1) ;$aArray needs to be where the different arrays are processed
MsgBox(0, "Encrypted data", $DataToBeEncrypted)
这就是您应该如何处理数组元素。
;Cuts the input up into piece;
$VariableToBeCut = "12345678"
$aArray = StringRegExp($VariableToBeCut, ".{2}", 3)
ConsoleWrite("Array element 0: " & $aArray[0] & @LF) ; personal check to make sure array works
For $i = 0 To UBound($aArray)-1
$DataToBeEncrypted = _EncryptionProcess($aArray[$i], $keyvalue, $keysize, 1)
ConsoleWrite("Element " & $i & " : " & $aArray[$i] & " DataToBeEncrypted: " & $DataToBeEncrypted & @LF)
Next