Saving dialog entries with ini file.

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
thepenguin99
Newbie
Posts: 8
Joined: Thu Jun 07, 2007 10:45 pm

Saving dialog entries with ini file.

Post by thepenguin99 » Mon Jun 11, 2007 7:48 pm

Ok I have a dialog that gets information from the user to setup the program being automated. Since this information is generally the same after they enter it once I want it to save it for the next time the macro runs. I am trying to use the ReadIniFile and EditIniFile commands to accomplish this. I only want it to edit the ini if the start button is pressed. Code below.

Code: Select all

ReadIniFile>C:\macrofolder\Settings.ini,Login,Username,Username


Dialog>Dia
   Caption=macroname
   Width=306
   Height=318
   Top=CENTER
   Left=CENTER
   Max=1
   Min=1
   Close=1
   Resize=1
   Label=Type Username Below:,8,8,true
   Edit=User,8,24,153,%Username%
   Edit=Pass,8,72,153,,*
   Label=Type Password Below:,8,56,true
   Button=Resume already running,16,152,137,25,1
   Button=Start program,16,112,137,25,3
EndDialog>Dia


Show>Dia,r
If>r=3,LogSet
If>r=1,Station2
If>r=2,Exit

Label>LogSet
  EditIniFile>C:\macrofolder\Settings.ini,Login,Username,%Dia.User%
[/Textarea]

thepenguin99
Newbie
Posts: 8
Joined: Thu Jun 07, 2007 10:45 pm

Post by thepenguin99 » Mon Jun 11, 2007 9:12 pm

Nevermind found my problem.

ReadIniFile>C:\macrofolder\Settings.ini,Login,Username,Username

The result variable needed to be named something else for the editinifile to work.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts