![]() |
|
What is the physical difference between the two?!! - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Coding (https://sinister.ly/Forum-Coding--71) +--- Thread: What is the physical difference between the two?!! (/Thread-What-is-the-physical-difference-between-the-two) Pages:
1
2
|
What is the physical difference between the two?!! - Jacob - 10-05-2011 I cannot figure it out. Not sure if my eyes are deceiving me or what but what is the difference in the two sets of code? this is autoit3 btw Dont say anything about letter cases (capital letters vs undercase letter) and the single quote over double quote (' over ") they all mean the same thing respectively. The code i handwrote Code: Dim $version = @AutoItVersion
Dim $computername = @ComputerName
Dim $OS = @OSVersion
Dim $text = ''
Switch $OS
Case 'Win_2008'
$OS = 'Windows Server 2008'
Case 'Win_vista'
$OS = 'Windows Vista'
Case 'Win_2003'
$OS = 'Windows Server 2003'
Case 'Win_xp'
$OS = 'Windows xp'
Case 'Win_2000'
$OS = 'Windows 2000'
Case 'Win_nt4'
$OS = 'Windows NT 4.0'
Case 'Win_me'
$OS = 'Windows ME'
Case 'Win_98'
$OS = 'Windows 98'
Case 'Win_95'
$OS = 'Windows 95'
Case Else
$OS = 'Unknown!'
EndSwitch
$text = 'Autoit Version = ' & $version & @CRLF
$text = 'Computer Name = ' & $computername & @CRLF
$text = 'Operating System = ' & $OS
MsgBox (0,'Computer Information',$text)The code presented. Code: Dim $version = @AutoItVersion
Dim $computername = @ComputerName
Dim $OS = @OSVersion
Dim $text = ""
Switch $OS
Case "WIN_2008"
$OS = "Windows Server 2008"
Case "WIN_VISTA"
$OS = "Windows Vista"
Case "WIN_2003"
$OS = "Windows Server 2003"
Case "WIN_XP"
$OS = "Windows XP"
Case "WIN_2000"
$OS = "Windows 2000"
Case "WIN_NT4"
$OS = "Windows NT 4.0"
Case "WIN_ME"
$OS = "Windows ME"
Case "WIN_98"
$OS = "Windows 98"
Case "WIN_95"
$OS = "Windows 95"
Case Else
$OS = "Unknown!"
EndSwitch
$text = "AutoIt Version = " & $version & @CRLF
$text &= "Computer Name = " & $computername & @CRLF
$text &= "Operating System = " & $OS
MsgBox (0, "Computer Information", $text)RE: What is the physical difference between the two?!! - Coder-san - 10-05-2011 Quote:$text &= 'Computer Name = ' & $computername & @CRLF ; the &= adds to the variable. same as doing $var=$var & 'extra stuff' In the code presented, the text is being appended to the $text variable, whereas you are just assigning the value. RE: What is the physical difference between the two?!! - Jacob - 10-05-2011 what? RE: What is the physical difference between the two?!! - Coder-san - 10-05-2011 The red text (&) is missing from your code in the 2nd last and 3rd last line. RE: What is the physical difference between the two?!! - Jacob - 10-05-2011 i dont know what is missing there...unless you're thinking the comments. the single line comments in au3 is starts with semicolon... im going to remove all comments from both of these. RE: What is the physical difference between the two?!! - Coder-san - 10-05-2011 You didn't get it. See: code presented: Quote:$text = "AutoIt Version = " & $version & @CRLF ; The & character concentrates (joins) two your code: Quote:$text = 'Autoit Version = ' & $version & @CRLF ; & joins the two values together. You wrote $text &= as $text = RE: What is the physical difference between the two?!! - Jacob - 10-05-2011 i saw that after a closer look into what you were saying! thank you!<33 im sorry for being a little under myself, and letting that go over my head...im a blonde ya know ![]() RE: What is the physical difference between the two?!! - Coder-san - 10-05-2011 Haha, no problem. It happens many times. The trick to finding the difference in these situations is open both in Notepad++ or a similar text editor, and try to format them exactly the same so that the textual differences become more revealing. RE: What is the physical difference between the two?!! - Jacob - 10-05-2011 scite4 for au3...its the editor default to au3. its based off the same platform as NP++ though.....i guess so many hours of looking at and writing code could mess with your eyes eh?
RE: What is the physical difference between the two?!! - 1234hotmaster - 10-06-2011 bleach is really addictive, 20 episodes per day XD that i even can't write 1 line of code of au3... i started bleach 5 days ago, i'm on epi 100 now lol if i wasn't addicted i'd help ya :whistle: |