Autohotkey - Saving an input field as a variable and pulling the value - variables

Essentially I have an application that loops to create multiple input fields that the user can enter numbers in. I need a loop as sometimes there will be anywhere from 10-15 input fields depending on the situation.
I have no problem looping and creating them, but I'm having trouble saving them in to a variable so they are accessible outside of the loop.
The reason I want them accessible so that I can then pull the value of the input fields. Anytime I try and pull the data it comes back blank/no data.
I have strong object oriented programming skills, but I'm very new to autohotkey scripting and wondering if there is a solution for this situation.
Any recommendation here or assistance is appreciated, thank you!

Related

Macro recorder or programmed macros, a button expedition

I am not proficient in either macro scripting in excel or scripting in general. I have a general sense of syntax and language formatting so I'm not necessarily going in empty handed with trying to program my owns scripts and I'm leaning this way due to the unique scenario I will be using the spreadsheet.
Essentially I'm wanting to track some data pertaining to slots for a pet project. What I desire is a "start" button that prompts which column I would like my "session" to start in, moves the selected cell to that column and prompts for a starting balance and fills it into the appropriate column; then there are a choice of buttons from which one that pertains to each of my bet options (there are 4) and that will fill in a column net to my balance with the appropriate amount as well as update the balance column to the next row. Lastly I would like to have 6(button) options for certain indicators I would like to track.
All of this I would like to run off of keyboard hotkeys if possible. Ultimately I'm mainly asking for resources since most of the "tutorials" show how to make a button, and some sense of hello world macros, but I'm mainly needing to find page navigation macros, input, take existing data, and append or modify that data with current variables.
-Thank You for any advice or resources and for your guys' time :D
I'm currently trying macro recording but it seems a little but specific to copy pasta situations and not so much the calculation, though small, but redundant that I could optimize with better scripting. I'm also finding that most of the buttons output to a text document outside of libre calc.

How can I replace a full image placeholder by an empty one?

I would like to programatically delete image placeholders which are full (PlaceholderPicture objects in the python-pptx API)
and replace them with empty ones (PicturePlaceholder), the goal being to "refresh" pictures instead of always having to fill out an empty presentation.
I think I know how to delete a shape, but creating a new PicturePlaceholder proves harder than expected.
When I try to create one I am asked to provide a sp and a parent and I cannot find in the documentation what these parameters refer to.
Does my approach make sense, and if so is it possible to create new placeholders programmatically? Could anyone explain what are the parameters I should pass to the constructor?
Thanks in advance.
python-pptx has no API support for this, which means you would need to directly manipulate the underlying XML of the slide to accomplish it (and be outside the python-pptx "safety net").
sp is the shape element (generally an <p:sp> element, hence the name) and parent would be a reference to the slide.
As a general approach, I would create an empty placeholder and compare its XML to that of a "filled" placeholder which is the same in every respect. Then the job is to make one into the other.
Note that a picture placeholder has a relationship to the "image part" (e.g. PNG file) stored elsewhere in the PPTX package (.pptx file). This will need to be dealt with and not left dangling.
Another possibility is just to swap the image and leave everything else in place, which on paper at least would be less disruptive.
Because none of these options has API support, pursuing them involves taking on responsibility for a lot of details that python-pptx takes care of for you and learning a fair amount about the internals. If that sounds like something you'd rather avoid then you'll want to find another way to accomplish the broader outcome you have in mind.

Graphing richtextbox data?

I'm pretty new to vb so please bear with me here. I have data going into some richtextboxes and I wanted to graph it, what would be the best way of going about graphing something in vb.net like this? I'm thinking rather than trying to read from the textboxes themselves (as the data is being inputted as strings) I'd convert the data going in into doubles and try to graph it. Any suggestions? Would it be possible to graph the data in the actual boxes, since they're strings at that point rather than doubles, or would graphing the numbers just be easier?
I think the whole richtextbox part of your question is just causing confusing. If you have the data out of the textboxes, putting it into a richtextbox and then pulling it back out doesn't make sense.
The values will obviously need to be converted to a number somewhere during the process. Are you using a control to graph, or handling that code yourself? If you're using a control, then check the documentation.

Get vendor name to Smartform?

I'm kind of a newbie in smartforms. I'm trying to get some data from KNA1 like the name and the address to show on delivery note. How do I get this? I know I have to put the tables in some option of "global option" but I just don't know which one. Please, can someone help me? Thanks.
You'll need to know how to develop ABAP coding for this. Assuming that you know this, you should try to extend the input structures of the form and add the necessary selection logic to the supplying program. If this is not possible, you can add code to the form, but that's not recommended for various reasons.
EDIT:
If you do know how to code ABAP, it's even harder to understand your question. I assume you have taken a look at the excellent online doumentation. If you inspect the header entries of a form, you'll note stuff like global definitions and initialization coding. If you take a closer look at the elements you can insert in a form, you'll discover program lines. So this is one way to embed ABAP code in a form that will select data from the database. You'd print it out like any other field.
However, this is a bad idea. It will generally slow your form processing down and is a nightmare to maintain if used too widely. Instead, you should take a look at the parameters of the form and the program that is calling the form. If possible, edit the appropriate structure or use an append structure to add the additional fields. Then, use a BAdI, user exit or an implicit enhancement to fill the fields in the calling program. The advantage of this is that the data will be passed to all forms and you won't have to copy the logic throughout multiple forms. (Also, it will be easier to port this to Interactive Forms if you'll ever have to).
Every smartform has a form interface which is the primary way of passing information to it (under "Global Settings" in the form tree). When this information is missing and you can not change the interface as well as the ABAP code which calls it for some reason (because it's called at too many different places or because it's called from SAP standard code) there are still ways to integrate ABAP coding into a smartform to get any additional data:
You can click the "Global Definitions" to define global variables and global form routines
You can add a "Flow Logic -> Program Lines" node to a window node. Here you can write some ABAP code to read the data you need and write it into a global variable.
You can then use this variable in the text elements of the window.

Programming Theory: Saving VB.NET

What is the best way to save the state of a program. Maybe that is not the right way to describe it but, what I mean is almost any application you can input a whole bunch of data make selections and choices and then save these in files unique to the application your working with.
For the time being I will ask my question in term of VB.NET since it is what I am currently working with. I understand the use of the stream writer to write data to a file (any file extension can be used even your own made up one) and then you can later open the file with the stream reader and load the saved application state. At least that is what I know how to do.
Are there other ways to approach saving the state? In my case I have a dictionary that is defined through user input to store a lot of data and I am trying to find the best way to save the dictionary so I can load it again.
I would suggest the best way to save state is the way that makes sense to you (and presumably fits in with your architectural style).
There are various locations and methods of encoding state into a file but, with the exception of a few extreme cases, there's unlikely to be any (user) perceivable performance differences between the techniques.
If one was feeling especially concerned about such things, it might be worth hiving off the reading or writing of state onto a background worker thread but I'd probably hold off on that if / until you actually start running into any disk bound perf issues.
You can actually do this using vs.net IDE and click your way to happiness. Click a control where you want to save the state, then expand the ApplicationSettings in properties. Then click the ... (box) by PropertyBinding. Now choose the property you want to store the setting for and click New. Now name your setting and select whether it is a per user setting or a application setting in the scope.
OMG, THAT IS IT, AMAZING!
Now, when you want to save the state of a windows form, just put in your code:
My.Settings.Save()