millisys Posted January 28, 2015 Posted January 28, 2015 Hi, Is there a way to renew a script's #Include? I know this is a strange request, but I am asking because the contents of a file that are included in a script I am working on change throughout the execution of the script. If it is not possible to renew the #Include, is it possible to change the contents of the #Include. I have noticed that if I delete the included file after the script is running, it continues to runs so it seems as though the #include data is stored somewhere either in the computer's ram or on the hard drive. Thank you for your help.
Moderators Melba23 Posted January 28, 2015 Moderators Posted January 28, 2015 millisys,When you include a file in a script it is as if you pasted the content of the file into your script at the point you placed the #include line. So there is no way you can change the content once running. >Perhaps if you were to explain a little more clearly what exactly you want to do we might be able to offer an alternative method. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
javiwhite Posted January 28, 2015 Posted January 28, 2015 Hi Millisys, The #include file is expanded at runtime, So editing the include file would not have any effect whilst the script itself is running, Much like editing the main script wouldn't. What are you trying to achieve with this? Perhaps it can be achieved through other means... - Javi give a man an application, and he'll be frustrated for the day, Teach him how to program applications and he'll be frustrated for a lifetime.
millisys Posted January 28, 2015 Author Posted January 28, 2015 Hi Melba23 and javiwhite. Basically, script#1 dynamically writes script#2 and I need the data from script#2 in #script#1 for the next writing of script#2. I am trying to execute script#2 inside of a script#1 loop instead of running script#2 with shellexecutewait because I will then have to write a lot of information that will need to written to and from an ini file as script#1 and script#2 communicate.
Moderators Melba23 Posted January 28, 2015 Moderators Posted January 28, 2015 millisys,Clear as mud! How about some real explanation of what is going on? If you really want to pass information back from #script2# to #script1# then you will need some form of InterProcessCommunication (IPC) - my personal favourite is MailSlot. But again, if you explain a bit more, we might be able to offer other solutions. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
millisys Posted January 28, 2015 Author Posted January 28, 2015 (edited) Hi Melba23, script1 reads solar panels and builds arrays based upon this data. Using the data in the arrays, it generates new lines of code to be processed by script1 in a later loop. As it executes the newly written code, it compares the data from the existing arrays with the newly created arrays. It works perfectly when I manually input the lines into script1, but when I attempt to automate the inclusion of the code into script1 using #include, the lines of code are not updating. What you said in your first post is exactly what I am trying to achieve, I want the lines of code to run exactly as though they had been pasted into the script. Thank you. Edited January 28, 2015 by millisys
JohnOne Posted January 28, 2015 Posted January 28, 2015 Take a look at "running scripts" section in help file, under the "contents" tab, and particularly "/AutoIt3ExecuteScript" switch. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
jdelaney Posted January 28, 2015 Posted January 28, 2015 Or, output whatever data to a simple text file, or ini, or xml...loop through the file, and have whatever you need scripted based on that. Then you would just need a loop to create the file, and process it. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
millisys Posted January 28, 2015 Author Posted January 28, 2015 Hi JohnOne, I have tried the AutoIt3ExecuteScript but unfortunately the variable values generated when executed are not available to be used in script1
millisys Posted January 28, 2015 Author Posted January 28, 2015 Hi jdelaney, I agree that this method will work, but I have hundreds of array values that would have to be written
Moderators Melba23 Posted January 28, 2015 Moderators Posted January 28, 2015 millisys,How time sensitive is that data? How long between each run? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
jdelaney Posted January 28, 2015 Posted January 28, 2015 Hi jdelaney, I agree that this method will work, but I have hundreds of array values that would have to be written That's what scipting is for ...you find the common denominators, and loop accordingly. Do it right once, and it will work until something new comes about, or something else drastic changes. Without data, can't help much more. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
millisys Posted January 28, 2015 Author Posted January 28, 2015 Hi Melba23, the data is not time-sensitive. It is run at night when the panels aren't active.
Moderators Melba23 Posted January 28, 2015 Moderators Posted January 28, 2015 millisys,As time is not a factor, jdelaney's idea of getting #script2# to write the data to file to be read in later by #script1# would be a sensible way to go. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
millisys Posted January 28, 2015 Author Posted January 28, 2015 (edited) Hi Melba23, the script generates millions of arrays overnight. I have tried writing to the ini file but it slows down considerably. My goal is to keep the data in the arrays so that it stays in ram and is quicker. Edited January 28, 2015 by millisys
millisys Posted January 28, 2015 Author Posted January 28, 2015 Is there a way to get a script2 generated array back to script1 without writing to disk?
jdelaney Posted January 28, 2015 Posted January 28, 2015 (edited) nope: _FileWriteFromArray _FileReadToArray I guess you could get tricky and initiate the script with tcpip, and then report back to the driver. That would effectivly require 3 scripts...one to always be listening, and create the 3rd script, and report back the resutls...and another script to tell the listener what to do. But why do that, when you can easily create an XML file, and loop through it. Edited January 28, 2015 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
BrewManNH Posted January 28, 2015 Posted January 28, 2015 What exactly is in these millions of arrays? I know it's data from the solar panels, I would like to find out exactly what this information looks like. It might make things easier when trying to help. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
millisys Posted January 28, 2015 Author Posted January 28, 2015 What exactly is in these millions of arrays? Hi BrewManNH, it is output voltages from each of the panels combined with positioning data (C=voltages!positions!) generated throughout the day to evaluate and optimize efficiency
millisys Posted January 28, 2015 Author Posted January 28, 2015 (edited) But why do that, when you can easily create an XML file, and loop through it I feel more comfortable with data staying in ram rather than being written to hard disk. It's ok with settings info, but constant hammering of the hard drive to transfer array data makes me concerned about data integrity Edited January 28, 2015 by millisys
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