I cannot seem to include a Action.WriteINI line into a "If, then, else" conditional loop. Here's what I'm trying to do:
I have 6 hotspots. I click a button and I get 6 random buttons in their place. I click it again and I get 6 more random buttons etc. That part works great using a random generator to populate a chal1 variable for button 1, chal2 for button 2, chal3 for button 3, and so on. Now, I need to be able to click on a button, and depending what it is, write to an INI file. The condition I use is this:
- Code: Select all
If chal1 = 1 Then
Action.WriteINI "P:\Pushfile.dd",1,1, "Button 1"
ElseIf chal1 = 2 Then
Action.WriteINI "P:\Pushfile.dd",1,1, "Button 2"
ElseIf chal1 = 3 Then
Action.WriteINI "P:\Pushfile.dd",1,1, "Button 3"
This is only for the first 3 but you should get the idea. I use the same type of code for randomizing the buttons and it works fine. I have even verified that the variable is valid by creating a test field on the frame to display it. However, let say that variable "chal1" is 3, and I click the button #3, it does not write anything to the file. I have added some other code and it does execute withing the condition, so the coding is correct. I've also tried JUST the Action.WriteINI "P:\Pushfile.dd",1,1, "Button 3" line and it works perfectly, just NOT with the conditional statement.
I'm at my wits end. Can someone explain why Action.????? works inside a If/then/else statement but WriteINI won't?
Oh, I've even tried a single line condition:
- Code: Select all
If chal1 = 1 then Action.WriteINI "P:\Pushfile.dd",1,1, "Button 1"
If chal1 = 2 then Action.WriteINI "P:\Pushfile.dd",1,1, "Button 2"
If chal1 = 3 then Action.WriteINI "P:\Pushfile.dd",1,1, "Button 3"
Nothing works. Why?
Thanks