Daily report 2012/12/25

4 views
Skip to first unread message

Chris

unread,
Dec 25, 2012, 8:58:03 AM12/25/12
to qda_...@googlegroups.com
hey Jenney:

this is for you. this function will get OS bit by querying WMI.
; ----------------------------------------------------------------------------
; Function Name :   _GetOSBit
; Description :  it will Get current OS bit , maybe 32 ,maybe 64
; Parameter(s) :  None
; Syntax : _GetOSBit()
; Return Value(s) : 32 or 64 (int)
; Author(s) :  GDDL PA SW Automation Team (Chris Hong)
; ----------------------------------------------------------------------------
Func _GetOSBit()

 
Dim $objProcess
 
Dim $intOSBit

 $objProcess
= ObjGet("winmgmts:root\cimv2:Win32_Processor='cpu0'")
 $intOSBit
= $objProcess.AddressWidth
 
Return $intOSBit
EndFunc   ;==>_GetOSBit


Today I finished some function about  two-dimensional array operation .  first is append a two-dimensional array to another two dimensional-array. But it is not stable and flexible. I know it is not good. But I will complete it soon.

Func _2AryAdd($ary1,$ary2)
 
;If IsArray($ary1) Or IsArray($ary2) Then
 
; MsgBox(0,"","Invalid array")
 
; Exit
 
;EndIf

 
Local $iAryLen1 = UBound($ary1)
 
Local $iAryLen2 = UBound($ary2)

 
Local $iAryWigthLen1 =  UBound($ary1,2)
 
Local $iAryWightLen2 =  UBound($ary2,2)
 
Local $iaryWightLen  =  0

 
If $iAryWigthLen1 = $iAryWightLen2 then
 $iaryWightLen
= $iAryWigthLen1
 
ElseIf $iAryWigthLen1 > $iAryWightLen2 Then
 $iaryWightLen
= $iAryWigthLen1
 
Else
 $iaryWightLen
= $iaryWightLen2
 
EndIf

 
ReDim $ary1[$iAryLen1 + $iAryLen2 ][$iaryWightLen]

 
For $i = 1 To $iAryLen2
 $ary1
[$iAryLen1 + $i - 1][0] = $ary2[$i - 1][0]
 $ary1
[$iAryLen1 + $i - 1][1] = $ary2[$i - 1][1]
 
Next

 
Return $ary1
EndFunc

Not a big deal. Just some regular operation of array. any question pls mail to me.

Arthur

unread,
Dec 26, 2012, 8:43:11 AM12/26/12
to qda_...@googlegroups.com
Chris,
         _2AryAdd is a pretty cool function. You can do more optimize on it, and then try to submit is as an UDF to AutoIt official website.........
         pls add some comment in the code, and pay more attention to Naming conventions, make your code more QDA_SW style.  *_*
Reply all
Reply to author
Forward
0 new messages