Jump to content

Renew #Include


 Share

Recommended Posts

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.

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Moderators

millisys,

Clear as mud! How about some real explanation of what is going on? :D

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 by millisys
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

  • Moderators

millisys,

How time sensitive is that data? How long between each run? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 by millisys
Link to comment
Share on other sites

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 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.
Link to comment
Share on other sites

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 Gude
How 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

Link to comment
Share on other sites

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 by millisys
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...