Author Topic: Zenity and QB64  (Read 3405 times)

0 Members and 1 Guest are viewing this topic.

Offline George McGinn

  • Global Moderator
  • Forum Regular
  • Posts: 210
    • View Profile
    • Resume
Zenity and QB64
« on: June 18, 2021, 04:08:23 pm »
I'm not sure if this is me, QB64, Zenity, pipecom, or a mixture of all.

I took an example from the Zenity documentation, and it is presenting me with garbage. Here is the code from the documentation, my QB64 code, and a screen print of what I am getting.

I originally had all the parameters in, but I removed the "--title" and the ">> addr.csv" and reordered it the same way as the code given to me by Spriggs, with no changes in my results.

The commented out part works fine (It is Spriggs code that was provided).

From Zenity Documentation (just the portion of the BASH script that is the call to Zenity):
Code: [Select]
zenity --forms --title="Add Friend" \
--text="Enter information about your friend." \
--separator="," \
--add-entry="First Name" \
--add-entry="Family Name" \
--add-entry="Email" \
--add-calendar="Birthday" >> addr.csv

QB64:
Code: QB64: [Select]
  1. '$CONSOLE:ONLY
  2. '_DEST _CONSOLE
  3. DIM AS STRING email, dates, other, form, birthday, firstname, lastname
  4.  
  5. 'form = pipecom_lite("zenity --forms --add-entry=" + CHR$(34) + "Email" + CHR$(34) + _
  6. '                    " --add-calendar=" + CHR$(34) + "Pick date" + CHR$(34) + _
  7. '                    " --text=" + CHR$(34) + "This is a form made in zenity" + CHR$(34) + _
  8. '                    " --add-entry=" + CHR$(34) + "Ultimate Haxxor" + CHR$(34) _
  9. '                    )
  10.  
  11.  
  12. form = pipecom_lite( _
  13.                     "zenity --forms --add-entry=" + CHR$(34) + "First Name" + CHR$(34) + _
  14.                     "--add-calendar=" + CHR$(34) + "Birthday" + CHR$(34) + _
  15.                     "--text=" + CHR$(34) + "Enter information about your friend." + CHR$(34) + _
  16.                     "--add-entry=" + CHR$(34) + "Last Name" + CHR$(34) + _
  17.                     "--add-entry=" + CHR$(34) + "Email" + CHR$(34) _
  18.                     )
  19.  
  20.  
  21.  
  22. 'email = MID$(form, 1, INSTR(form, "|") - 1)
  23. 'PRINT email
  24. 'form = MID$(form, INSTR(form, "|") + 1)
  25. 'dates = MID$(form, 1, INSTR(form, "|") - 1)
  26. 'PRINT dates
  27. 'other = MID$(form, INSTR(form, "|") + 1)
  28. 'PRINT other
  29.  
  30. '$INCLUDE:'pipecomqb64.bas'

Here is the run results:
  [ You are not allowed to view this attachment ]  
____________________________________________________________________
George McGinn
Theoretical/Applied Computer Scientist
Member: IEEE, IEEE Computer Society
Technical Council on Software Engineering
IEEE Standards Association
American Association for the Advancement of Science (AAAS)

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Zenity and QB64
« Reply #1 on: June 18, 2021, 04:13:21 pm »
@George McGinn Looks like you need a space before each of your arguments. In the commented code right above yours, there is a space just before each new argument. That would be my guess as to why it isn't working. It's not able to parse it without the spaces.
Shuwatch!

Offline George McGinn

  • Global Moderator
  • Forum Regular
  • Posts: 210
    • View Profile
    • Resume
Re: Zenity and QB64
« Reply #2 on: June 18, 2021, 05:07:16 pm »
Thanks. That makes sense.

When I am done testing my iOS App, I will give that a try.


@George McGinn Looks like you need a space before each of your arguments. In the commented code right above yours, there is a space just before each new argument. That would be my guess as to why it isn't working. It's not able to parse it without the spaces.
____________________________________________________________________
George McGinn
Theoretical/Applied Computer Scientist
Member: IEEE, IEEE Computer Society
Technical Council on Software Engineering
IEEE Standards Association
American Association for the Advancement of Science (AAAS)

Offline George McGinn

  • Global Moderator
  • Forum Regular
  • Posts: 210
    • View Profile
    • Resume
Re: Zenity and QB64
« Reply #3 on: June 18, 2021, 05:38:46 pm »
@SpriggsySpriggs

It works. I like it. I have no idea why I didn't think about the spaces (probably because on the BASH script, it wasn't apparent).

While it is not InForm, and it is very simplistic, if you want something quick on Linux, this is a great tool to create basic GUI's.

When put everything back in from the BASH example, it works great. It even writes the results to a file with " >> addr.csv" tacked on to the end. (addr.csv can be any file name you chose).

When it writes to a file, you cannot print it to the terminal, and when you do multiple writes, it appends it to the end of existing data, if the file exists. (For those who want to know more about how it works)

George.
____________________________________________________________________
George McGinn
Theoretical/Applied Computer Scientist
Member: IEEE, IEEE Computer Society
Technical Council on Software Engineering
IEEE Standards Association
American Association for the Advancement of Science (AAAS)

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Zenity and QB64
« Reply #4 on: June 19, 2021, 04:19:34 am »
"File pipecomqb64.bas not found..." after cutting and pasting into the IDE....
Logic is the beginning of wisdom.

Offline George McGinn

  • Global Moderator
  • Forum Regular
  • Posts: 210
    • View Profile
    • Resume
Re: Zenity and QB64
« Reply #5 on: June 19, 2021, 10:21:39 am »
@johnno56 - You can find it at: https://www.qb64.org/forum/index.php?topic=3981.msg133226#msg133226

"File pipecomqb64.bas not found..." after cutting and pasting into the IDE....
« Last Edit: June 19, 2021, 10:22:53 am by George McGinn »
____________________________________________________________________
George McGinn
Theoretical/Applied Computer Scientist
Member: IEEE, IEEE Computer Society
Technical Council on Software Engineering
IEEE Standards Association
American Association for the Advancement of Science (AAAS)

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Zenity and QB64
« Reply #6 on: June 19, 2021, 09:02:19 pm »
Thanks George.

J
Logic is the beginning of wisdom.