Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
InForm-PE
#41
Quote:If I click on "Calculate" (Berechnen) under VB, then I can program it, but how does it work in InForm?
Well, unlike VB, QB64 does not have user created callbacks / event handlers.

Hence, you will find that the ".bas" that InForm generates will have a bunch of subroutines with "SELECT CASE". Use these functions to handle the UI events.

For example, __UI_Click() handles all control click events. Also note that all controls have a unique ID and hence the usage of LONG.

Code: (Select All)

SUB __UI_Click (id AS LONG)
    SHARED Game AS GameType

    SELECT CASE id
        CASE GameMenuExit
            OnExit

        CASE HelpMenuAboutFourUp
            MessageBox "Four Up: Classic Connect 4 game\n\nCopyright (c) 2024 Samuel Gomes\n\nhttps://github.com/a740g/", Caption(FourUp) + " - About", MsgBox_Information

        CASE GameMenuUndo
            IF NOT GameBusy AND GameGetPlayer = GAME_BOARD_PLAYER_O AND GameGetMoves > 1 THEN
                GameBusy = TRUE
                GameUndoMove ' undo AI move
                GameUndoMove ' undo player move
                GameBusy = FALSE
            END IF


See the InForm-PE wiki for more details: https://github.com/a740g/InForm-PE/wiki
Reply
#42
First of all, thank you for your effort! The structure is now like this and it works.

[Image: Lab-In-Form2024-02-16.jpg]

Now it's about program execution; see screenshots. There is no error message, but also no result. I didn't find any reference to this in the wiki either. Is it actually as correct as I'm trying to do, or does it work completely differently in these case loops? Thanks!

It are Numeric Input Boxes now.
[Image: 1ter-Versuch2024-02-16-162456.jpg]

And so . . .

[Image: 2ter-Versuch2024-02-16-162620.jpg]
Reply
#43
a740g,
I'm having trouble on how I should solve this problem. I know the script for linux tells me it can not find QB64pe to compile the InForm-PE-master. Here is my terminal action and errors:

<user-login>@pop-os:~/Documents/InForm-PE-master$ sh ./setup_inform_lnx.sh
Compiling InForm...
rm -fr UiEditor InForm/UiEditorPreview InForm/vbdos2inform
../QB64pe/qb64pe -x -w -e InForm/UiEditor.bas -o UiEditor
make: ../QB64pe/qb64pe: No such file or directory
make: *** [makefile.inform:36: UiEditor] Error 127
<user-login>@pop-os:~/Documents/InForm-PE-master$ $PATH
bash: /home/<user-login>/Documents/qb64pe:/home/<user-login>/Documents/qb64pe/fonts:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin: No such file or directory
<user-login>@pop-os:~/Documents/InForm-PE-master$
 
InForm-PE-master and qb64pe are in the Documents folder. I intending to install InForm-PE in the Documents folder besides the qb64pe folder. What do I need to do to get the script install it?
Reply
#44
(02-16-2024, 03:58 PM)Kernelpanic Wrote: First of all, thank you for your effort! The structure is now like this and it works.

[Image: Lab-In-Form2024-02-16.jpg]

Now it's about program execution; see screenshots. There is no error message, but also no result. I didn't find any reference to this in the wiki either. Is it actually as correct as I'm trying to do, or does it work completely differently in these case loops? Thanks!

It are Numeric Input Boxes now.
[Image: 1ter-Versuch2024-02-16-162456.jpg]

And so . . .

[Image: 2ter-Versuch2024-02-16-162620.jpg]
Can you share the InForm generated .bas and .frm files so that I can take a look?

(02-16-2024, 05:26 PM)GareBear Wrote: a740g,
I'm having trouble on how I should solve this problem. I know the script for linux tells me it can not find QB64pe to compile the InForm-PE-master. Here is my terminal action and errors:

<user-login>@pop-os:~/Documents/InForm-PE-master$ sh ./setup_inform_lnx.sh
Compiling InForm...
rm -fr UiEditor InForm/UiEditorPreview InForm/vbdos2inform
../QB64pe/qb64pe -x -w -e InForm/UiEditor.bas -o UiEditor
make: ../QB64pe/qb64pe: No such file or directory
make: *** [makefile.inform:36: UiEditor] Error 127
<user-login>@pop-os:~/Documents/InForm-PE-master$ $PATH
bash: /home/<user-login>/Documents/qb64pe:/home/<user-login>/Documents/qb64pe/fonts:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin: No such file or directory
<user-login>@pop-os:~/Documents/InForm-PE-master$
 
InForm-PE-master and qb64pe are in the Documents folder. I intending to install InForm-PE in the Documents folder besides the qb64pe folder. What do I need to do to get the script install it?

I think it's happening because the case of the directory name (QB64pe vs qb64pe). Edit the script and then change all instances of QB64pe to qb64pe.

I'll update the script so that it looks in both places in a future update.
Reply
#45
a740g,

That helps but still no install.

Here is what I did to the script:

#!/bin/bash
# InForm for QB64-PE Setup script

cd "$(dirname "$0")"

echo "Compiling InForm..."
make -f makefile.inform clean OS=lnx QB64PE_PATH=../qb64pe/
make -f makefile.inform OS=lnx QB64PE_PATH=../qb64pe/

Here is the terminal output:

 <user-login>@pop-os:~/Documents/InForm-PE-master$ sh ./setup_inform_lnx.sh
Compiling InForm...
rm -fr UiEditor InForm/UiEditorPreview InForm/vbdos2inform
../qb64pe/qb64pe -x -w -e InForm/UiEditor.bas -o UiEditor
QB64-PE Compiler V3.11.0

Beginning C++ output from QB64 code...
[...........................................      ] 86%
Syntax error
Caused by (or after):WRITESETTING "InForm/InForm.ini",17 , "InForm Settings",15 , "Swap mouse buttons",18 , VALUE$
LINE 2603:WriteSetting "InForm/InForm.ini", "InForm Settings", "Swap mouse buttons", value$
make: *** [makefile.inform:36: UiEditor] Error 1

<user-login>@pop-os:~/Documents/InForm-PE-master$

This is what I got. Any ideas?
Reply
#46
@GareBear Sorry about that. I fixed the issue and pushed the fix on GitHub.

I also updated the setup scripts.
The setup scripts now take a directory argument (for the QB64-PE directory). It however will look in known places if you do not supply one.

So, for example, now you can do:

./setup_inform_lnx.sh ~/mydev/qb64pe/

Get the latest from https://github.com/a740g/InForm-PE/archi...master.zip
Reply
#47
Quote:Can you share the InForm generated .bas and .frm files so that I can take a look?
Of course! Look 7z-file.


Attached Files
.7z   Prozent_16-02-2024.7z (Size: 1.81 KB / Downloads: 21)
Reply
#48
This is what ran:

 <user-login>@pop-os:~/Documents/InForm-PE-master$ sh ./setup_inform_lnx.sh
./setup_inform_lnx.sh: 6: Syntax error: "(" unexpected (expecting "fi")
<user-login>@pop-os:~/Documents/InForm-PE-master$ sh ./setup_inform_lnx.sh ~/Documents/qb64pe/
./setup_inform_lnx.sh: 6: Syntax error: "(" unexpected (expecting "fi")
<user-login>@pop-os:~/Documents/InForm-PE-master$

This is the new script setup you uploaded:

 #!/bin/bash
# InForm for QB64-PE Setup script

# Check if QB64-PE directory path is provided as an argument
if [ -n "$1" ]; then
    QB64PE_PATHS=("$1" "../qb64pe/" "../QB64pe/")
else
    QB64PE_PATHS=("../QB64pe/" "../qb64pe/")
fi

cd "$(dirname "$0")"

echo "Compiling InForm..."

# Loop through each QB64-PE path
for path in "${QB64PE_PATHS[@]}"; do
    make -f makefile.inform clean OS=lnx QB64PE_PATH="$path"
    make -f makefile.inform OS=lnx QB64PE_PATH="$path"
    if [ $? -eq 0 ]; then
        break  # If build succeeds, exit loop
    fi
    echo "Build failed with QB64-PE path: $path"
done

This is the error I get:

Syntax error: "(" unexpected (expecting "fi")

What do get out of this error?
Reply
#49
(02-16-2024, 09:20 PM)Kernelpanic Wrote:
Quote:Can you share the InForm generated .bas and .frm files so that I can take a look?
Of course! Look 7z-file.

I took some liberties with the code you shared and added a few elements to help clarify what is being called and when. I hope you find this helpful.


Attached Files
.zip   Prozent.zip (Size: 196.46 KB / Downloads: 8)
Reply
#50
(02-16-2024, 11:04 PM)GareBear Wrote: This is what ran:

 <user-login>@pop-os:~/Documents/InForm-PE-master$ sh ./setup_inform_lnx.sh
./setup_inform_lnx.sh: 6: Syntax error: "(" unexpected (expecting "fi")
<user-login>@pop-os:~/Documents/InForm-PE-master$ sh ./setup_inform_lnx.sh ~/Documents/qb64pe/
./setup_inform_lnx.sh: 6: Syntax error: "(" unexpected (expecting "fi")
<user-login>@pop-os:~/Documents/InForm-PE-master$

This is the new script setup you uploaded:

 #!/bin/bash
# InForm for QB64-PE Setup script

# Check if QB64-PE directory path is provided as an argument
if [ -n "$1" ]; then
    QB64PE_PATHS=("$1" "../qb64pe/" "../QB64pe/")
else
    QB64PE_PATHS=("../QB64pe/" "../qb64pe/")
fi

cd "$(dirname "$0")"

echo "Compiling InForm..."

# Loop through each QB64-PE path
for path in "${QB64PE_PATHS[@]}"; do
    make -f makefile.inform clean OS=lnx QB64PE_PATH="$path"
    make -f makefile.inform OS=lnx QB64PE_PATH="$path"
    if [ $? -eq 0 ]; then
        break  # If build succeeds, exit loop
    fi
    echo "Build failed with QB64-PE path: $path"
done

This is the error I get:

Syntax error: "(" unexpected (expecting "fi")

What do get out of this error?

I think you might be using something other than bash.
It works on my system. I'll take a look at this later.

In the meantime, run the following command. The script above basically does the same.
Assuming you have QB64-PE in ../qb64pe/

make -f makefile.inform clean OS=lnx QB64PE_PATH=../qb64pe/
make -f makefile.inform OS=lnx QB64PE_PATH=../qb64pe/
Reply




Users browsing this thread: 2 Guest(s)