Jump to content

User created variables


Go to solution Solved by Melba23,

Recommended Posts

Hey fellas,

I'm working on a script that will hopefully be used one day in the company I work for.

Now, there are multiple teams that work with the same system.

What I need to do is to allow every user to save his own set of predefined clicks. Let's say there are 6 buttons in the software - A, B, C, D, E and F and everyone clicks those buttons in a different order. I imagine a GUI with a combobox with two predefined sequences but with a save button somewhere near to allow the user to manually click the sequence representation in the GUI and save it under a name that he defines. This new preset would then appear in the combobox.

The thing is I have no idea how to get this done in autoit.

Am I playing with fire or is it not that hard?

Thank you for any help I can get.

Link to comment
Share on other sites

It's not difficult at all, you just need to decide how you will save the data across restarts.

For what you say, I believe an ini file will suffice.

Look at iniread() and iniwrite functions.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

The *.ini worked perfectly but as I'm not that skilled with GUI I need additional help.

Let's say I have two combo-boxes and several images (icons). What I need is when an image is clicked a combo-box gets updated. That wouldn't be that hard BUT a specific combo-box need to be updated, not both of them.

I imagine users clicking into a combo box they want to update and then clicking an icon and ONLY the combo-box selected would get updated. Is that something that could be done?

Link to comment
Share on other sites

  • Moderators

Seminko,

Yes, it is perfectly possible. :)

But rather than post simple questions (perhaps in the hope that some one will write the code for you ;)), why not post what code you have already so we can get a better idea of what you are trying to do and can then offer more focused assistance. ;)

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

Seminko,

Yes, it is perfectly possible. :)

But rather than post simple questions (perhaps in the hope that some one will write the code for you ;)), why not post what code you have already so we can get a better idea of what you are trying to do and can then offer more focused assistance. ;)

M23

Hey Melba,

actually quite the opposite. I'm looking for a direction to implement into my script, not the code itself. I found that is the best way to learn, rathen then copying a script and pasting it into my project.

To the point, I re-done the GUI and now I face another problem. I have multiple combo-boxes which are linked with GUICtrlRead($Combo1) to the *.ini file. Now, the *.ini file does not work with spaces but obviously I want the text in the combo-boxes to have spaces. Any clean way to get around that?

Thx

EDIT: Oh comooon... ini can have spaces? lol :-D

Edited by Seminko
Link to comment
Share on other sites

  • Moderators

Seminko,

My comment was "tongue-in-cheek" - do not take it personally. But commenting on some code is always much more likely to be productive than making suggestions which might, or might not, be suitable for any specific case. :)

As to the "space / no_space" problem - just replace the spaces when you store the data and restore them when you recall it. StringReplace is the function you need - and the italicised section at the beginning of this paragraph an example of how it might work . ;)

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

As per above, iniread etc does not have a problem with spaces.

Another issue --> Is there a function that would feed the ini sections into a combo box? I tried IniReadSectionNames but that does not work or I don't use it properly.

Link to comment
Share on other sites

  • Moderators

Seminko,

I seem to remember that you can have spaces in the "value" part of an ini entry - it is the "key" part that needs to be a single item. :)

IniReadSectionNames returns an array - you need to convert it to a delimited string to get the list into a combo. ;)

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

  • Moderators

Seminko,

Just loop through the array and concatenate the elements to a string - do not forget to add the delimiters. ;)

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

  • Moderators
  • Solution

Seminko,

Like this: ;)

Global $aArray[5] = [0, 1, 2, 3, 4]

$sString = ""
For $i = 0 To UBound($aArray) - 1
    $sString &= "|" & $aArray[$i]
Next

MsgBox(0, "String", $sString)
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

Seminko,

Like this: ;)

Global $aArray[5] = [0, 1, 2, 3, 4]

$sString = ""
For $i = 0 To UBound($aArray) - 1
    $sString &= "|" & $aArray[$i]
Next

MsgBox(0, "String", $sString)
M23

 

I figured it out. But I have two issues. First off the combo now correctly shows the section names but as the first entry there is the section count. I do not want that.

EDIT:

It says this: |3|Icon1|Icon2|Icon3|

The first '3' should not be there... how do I get rid of it?

Edited by Seminko
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...