Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8940173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:58:41+00:00 2026-06-15T10:58:41+00:00

My GUI and program work but just not as expected, so hear me out.

  • 0

My GUI and program work but just not as expected, so hear me out.

I wrote this program to take user input in the form of 1-10 example words for 3 categories.

The purpose of it is to output a text file with every triad permutation.

Unfortunately it is outputting permutations that aren’t triads.

It isn’t very much code, why is this happening?

ex.

GUI:

Colors Numbers Greek-letters

Red One Alpha
Blue Two Beta

output:

red one alpha
red one beta
red two alpha
red two beta
blue one alpha
blue one beta
blue two alpha
blue two beta

////////////////////////////////////////////////////////////////////////////////////

#include <GUIConstantsEx.au3>

$windowWidth = 600
$windowHeight = 430

$textFieldVertSpacing = 30

GUICreate("Semantic Intuition/Idea Naming Tool", $windowWidth, $windowHeight) 

GUISetBkColor (0xB0E2FF)

GUICtrlCreateLabel("Category A", 80, 10)
GUICtrlCreateLabel("Category B", 260, 10)
GUICtrlCreateLabel("Category C", 450, 10)

$categoryA = GUICtrlCreateInput("", (150*0)+(150/4)*1, 40, 150)
$categoryB = GUICtrlCreateInput("", (150*1)+(150/4)*2, 40)
$categoryC = GUICtrlCreateInput("", (150*2)+(150/4)*3, 40)

$example0 = GUICtrlCreateInput("", (150*0)+(150/4)*1, 80)
$example1 = GUICtrlCreateInput("", (150*0)+(150/4)*1, 80+$textFieldVertSpacing*1)
$example2 = GUICtrlCreateInput("", (150*0)+(150/4)*1, 80+$textFieldVertSpacing*2)
$example3 = GUICtrlCreateInput("", (150*0)+(150/4)*1, 80+$textFieldVertSpacing*3)
$example4 = GUICtrlCreateInput("", (150*0)+(150/4)*1, 80+$textFieldVertSpacing*4)
$example5 = GUICtrlCreateInput("", (150*0)+(150/4)*1, 80+$textFieldVertSpacing*5)
$example6 = GUICtrlCreateInput("", (150*0)+(150/4)*1, 80+$textFieldVertSpacing*6)
$example7 = GUICtrlCreateInput("", (150*0)+(150/4)*1, 80+$textFieldVertSpacing*7)
$example8 = GUICtrlCreateInput("", (150*0)+(150/4)*1, 80+$textFieldVertSpacing*8)
$example9 = GUICtrlCreateInput("", (150*0)+(150/4)*1, 80+$textFieldVertSpacing*9)

$example10 = GUICtrlCreateInput("", (150*1)+(150/4)*2, 80)
$example11 = GUICtrlCreateInput("", (150*1)+(150/4)*2, 80+$textFieldVertSpacing*1)
$example12 = GUICtrlCreateInput("", (150*1)+(150/4)*2, 80+$textFieldVertSpacing*2)
$example13 = GUICtrlCreateInput("", (150*1)+(150/4)*2, 80+$textFieldVertSpacing*3)
$example14 = GUICtrlCreateInput("", (150*1)+(150/4)*2, 80+$textFieldVertSpacing*4)
$example15 = GUICtrlCreateInput("", (150*1)+(150/4)*2, 80+$textFieldVertSpacing*5)
$example16 = GUICtrlCreateInput("", (150*1)+(150/4)*2, 80+$textFieldVertSpacing*6)
$example17 = GUICtrlCreateInput("", (150*1)+(150/4)*2, 80+$textFieldVertSpacing*7)
$example18 = GUICtrlCreateInput("", (150*1)+(150/4)*2, 80+$textFieldVertSpacing*8)
$example19 = GUICtrlCreateInput("", (150*1)+(150/4)*2, 80+$textFieldVertSpacing*9)

$example20 = GUICtrlCreateInput("", (150*2)+(150/4)*3, 80)
$example21 = GUICtrlCreateInput("", (150*2)+(150/4)*3, 80+$textFieldVertSpacing*1)
$example22 = GUICtrlCreateInput("", (150*2)+(150/4)*3, 80+$textFieldVertSpacing*2)
$example23 = GUICtrlCreateInput("", (150*2)+(150/4)*3, 80+$textFieldVertSpacing*3)
$example24 = GUICtrlCreateInput("", (150*2)+(150/4)*3, 80+$textFieldVertSpacing*4)
$example25 = GUICtrlCreateInput("", (150*2)+(150/4)*3, 80+$textFieldVertSpacing*5)
$example26 = GUICtrlCreateInput("", (150*2)+(150/4)*3, 80+$textFieldVertSpacing*6)
$example27 = GUICtrlCreateInput("", (150*2)+(150/4)*3, 80+$textFieldVertSpacing*7)
$example28 = GUICtrlCreateInput("", (150*2)+(150/4)*3, 80+$textFieldVertSpacing*8)
$example29 = GUICtrlCreateInput("", (150*2)+(150/4)*3, 80+$textFieldVertSpacing*9)

$generateTriadButton = GUICtrlCreateButton("Generate", ($windowWidth-100)/2, $windowHeight-40, 100)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Global $examplesA[10] = [$example0, $example1, $example2, $example3, $example4, $example5, $example6, $example7, $example8, $example9]
Global $examplesB[10] = [$example10, $example11, $example12, $example13, $example14, $example15, $example16, $example17, $example18, $example19]
Global $examplesC[10] = [$example20, $example21, $example22, $example22, $example24, $example25, $example26, $example27, $example28, $example29]

GUISetState(@SW_SHOW)                     


While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
         Case $generateTriadButton
            permutate()

            Exit
    EndSwitch

WEnd

Func permutate()

    $a = 0
    $b = 0
    $c = 0
    $x = 1

    $empty = ""

    $output = FileOpen(@ScriptDir & "\TriadOutput.txt", 2)

    While $a < 10
       while $b < 10
          while $c < 10


               ;MsgBox(0, "String length is:", StringLen($examplesA[$a]))
               If (StringStripWS(GUICtrlRead($examplesA[$a]), 8) <> "") AND (StringStripWS(GUICtrlRead($examplesB[$b]), 8) <> "") AND (StringStripWS(GUICtrlRead($examplesA[$a]), 8) <> "") Then

               FileWrite($output, $x)
               FileWrite($output, ")")
               FileWrite($output, " ")
               FileWrite($output, GUICtrlRead($examplesA[$a]))
               FileWrite($output, " ")
               FileWrite($output, GUICtrlRead($examplesB[$b]))
               FileWrite($output, " ")
               FileWrite($output, GUICtrlRead($examplesC[$c]))
               FileWrite($output, " ")
               FileWrite($output, @CRLF)

               $x = $x + 1

               EndIf

             $c = $c + 1
          WEnd
          $c = 0
          $b = $b + 1
       WEnd
       $b = 0
       $a = $a + 1
    WEnd

    FileClose($output)
EndFunc
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:58:42+00:00Added an answer on June 15, 2026 at 10:58 am

    Typical Copy-Paste-Error.

    Just replace the second $a in your last If-Statement (line 94) with $c and it works as expected…

    You find this out by verifying the output. The problem is, that every third text field is taken into account but the other two words work just fine. So the error must be in the expression (condition) responsible for the third field. And this is just in line 94…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GUI program, which would call a cmd in this GUI program.
I have a GUI program with one Exit button. When clicking this button, it
I've got a GUI C++ program that takes a shell command from the user,
Big picture: GUI shows user a list of their playlists. User picks one. Program
In a C# GUI program how do you move a tab control to the
I am writing a GUI program. In one part of it I show an
I am working on a small basic GUI program that gets the files from
I'm trying to make a GUI program with the Android SDK, using their Lunar
When I compile and run a simple Win32 GUI program in MinGW+MSys with command
I am a Python and Qt newbie... I am working on a GUI program

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.