Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/26/2021 in Posts

  1. Looking back at the initial problem posted by the OP, I don’t think it takes much more than: Func main() Local $var1, $var2 web_extraction($var1, $var2) StringStripWS($var1, 3) EndFunc Func web_extraction(ByRef $var1, ByRef $var2) $var1 = "extracted info 1" $var2 = "extracted info 2" EndFunc
    2 points
  2. @Danyfirex Interesting way of using static _ClassTest() Func _ClassTest() _1() _2() _3() EndFunc ;==>_Test Func _1() ConsoleWrite("Creating new class myclass" & @CRLF) _MyClass("Hello World") EndFunc ;==>_1 Func _2() ConsoleWrite("_2 MyData Value: " & _MyClass("Property2") & @CRLF) ;~ _MyData("") ;Clear _MyClass("Property2",_MyClass("Property2") & " - AutoIt Rocks!!!") ;Append Data EndFunc ;==>_2 Func _3() ConsoleWrite("_3 MyClass data: " & _MyClass() & @CRLF) _MyClass("ha") EndFunc ;==>_2 func ha() consolewrite("Hello AutoIt") endfunc Func _MyClass($propName = Default, $propData=Default) Local Static $Property1 = " a " Local Static $Property2 = " b " Local Static $Property3 = " c " Local Static $Property4 = " d " local static $method1 = ha() If @NumParams = 0 Then Return "{" & $property1 & ";" & $property2 & ";" & $property3 & ";" & $property4 & "}" if @NumParams = 1 then if isdeclared($propname) then return eval($propName) Else $property1=$propname EndIf EndIf If @NumParams = 2 then if isdeclared($propname) then assign($propname,$propdata) endif EndIf EndFunc ;==>_MyClass
    1 point
  3. Hello, Maybe this: _Test() Func _Test() _1() _2() _3() EndFunc ;==>_Test Func _1() ConsoleWrite("_1 Set MyData To 'Hello World'" & @CRLF) _MyData("Hello World") EndFunc ;==>_1 Func _2() ConsoleWrite("_2 MyData Value: " & _MyData() & @CRLF) ;~ _MyData("") ;Clear _MyData(_MyData() & " - AutoIt Rocks!!!") ;Append Data EndFunc ;==>_2 Func _3() ConsoleWrite("_3 MyData Value: " & _MyData() & @CRLF) EndFunc ;==>_2 Func _MyData($Data = Default) Local Static $MyData = "" If @NumParams = 0 Then Return $MyData $MyData = $Data EndFunc ;==>_MyData Saludos
    1 point
×
×
  • Create New...