blckpythn Posted August 16, 2012 Share Posted August 16, 2012 (edited) I am creating a little script that displays the current RAM in "#### MB" format but am having issues. The function for which I set the $RAM variable is this. $RAM = GetRAM() Func GetRAM() $Ramvar = MemGetStats() $Ram1 = $Ramvar[1] / 1024 $Ram2 = StringSplit($Ram1, ".") $Ram3 = $Ram2[1] & " MB" ConsoleWrite($Ram3) Return $Ram3 EndFunc While it ConsoleWrites the correct value, when I call it with GUICtrlCreateLabel, all I get is the number 9(Not even one of the numbers in the console.) Also I was trying to make it shorter with something like this but it doesn't even write a value to the console, and I still get a 9. $Ramvar = MemGetStats() $Ram1 = StringSplit(($Ramvar[1] / 1024), ".") & " MB" ConsoleWrite($Ram1) So does anyone know the cause of the 9 or why it stops writing to the console? Edited August 17, 2012 by blckpythn Link to comment Share on other sites More sharing options...
water Posted August 16, 2012 Share Posted August 16, 2012 Post the code where you set the label and we might see what's wrong. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Danyfirex Posted August 16, 2012 Share Posted August 16, 2012 Try this $Ramvar = MemGetStats() $Ram1 = StringSplit(($Ramvar[1] / 1024), ".") & " MB" ConsoleWrite($Ram1[1]) Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
blckpythn Posted August 17, 2012 Author Share Posted August 17, 2012 Sorry guys figured it out. I had used the $RAM variable to create a different GUI Label...I feel stupid. Thanks for your help though. Danyfirex, for the record all that did was remove the " MB" portion for some reason. Link to comment Share on other sites More sharing options...
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