ltjKt1 Posted August 25, 2010 Posted August 25, 2010 HI, I guess this is more of a general coding question. I hope you will still help. I have replaced my imaging batch files with a simple AutoIT exe. This has worked great, but I haven't really caught on as to how to manage data effectively. One place that is really messy is that I have constants for hardware strings that I search for, image paths, hardware names, etc. These are all directly related to each other, but I don't know how to relate them using the language. I currently tie them together by using case statements in functions. I am thinking that there is a better way (maybe using arrays). Here is an example of what I currently do: Global Const $PLATFORM_1 = "OptiPlex GX620" Global Const $PLATFORM_2 = "Profile 6" Global Const $PLATFORM_3 = "OptiPlex GX60" Global Const $PLATFORM_4 = "OptiPlex 745" Global Const $DELL_620 = "\MFR_BASE_Hardware_Images\Dell_Optiplex_620\CleanXP.GHO" Global Const $GATEWAY_PROFILE_6 = "\MFR_BASE_Hardware_Images\Gateway_Profile6\Profile6.GHO" Global Const $DELL_745 = "\MFR_BASE_Hardware_Images\Dell_Optiplex_745_SFF\745SFFBase.GHO" Global Const $DELL_GX280 = "\MFR_BASE_Hardware_Images\Dell_Optiplex_GX280\BASEXP.GHO" Func setMFRImagePath($pSelectedHardware) Local $Image Select Case $pSelectedHardware = $PLATFORM_1 $Image = $ELSDOLLAR & $DELL_620 Case $pSelectedHardware = $PLATFORM_2 $Image = $ELSDOLLAR & $GATEWAY_PROFILE_6 Case $pSelectedHardware = $PLATFORM_4 $Image = $ELSDOLLAR & $DELL_745 Case $pSelectedHardware = $PLATFORM_5 $Image = $ELSDOLLAR & $DELL_GX280 Case Else MsgBox(0, "Error", "No Images Available") EndSelect Return $Image EndFunc Thanks in advance for any help.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now