Author Topic: Strange Behaviour of RemoveItem  (Read 746 times)

0 Members and 1 Guest are viewing this topic.

Offline Qwerkey

  • Forum Resident
  • Posts: 764
Strange Behaviour of RemoveItem
« on: June 29, 2021, 05:44:04 AM »
I am (at least I hope that I am) writing a simple InForm program to make a prioritisable ToDo List.

When the RemoveItem function is activated, the remaining items in the ListBox coalesce into the first item position.  If the program is exited and restarted, the remaining items are in the correct positions.  See video.

I am writing this simple program to get back into the basics of QB64, and I suspect that this is user incompetence.

The relevant program line is:
Code: QB64: [Select]
  1. RemoveItem ToDoListBX, Control(ToDoListBX).Value


Offline FellippeHeitor

  • QB64 Developer
  • Forum Resident
  • Posts: 3064
  • Let it go, this too shall pass.
    • QB64.org
Re: Strange Behaviour of RemoveItem
« Reply #1 on: June 29, 2021, 06:22:45 AM »
RemoveItem has been fixed in the development build - but it's a build so new it's not even made it to auto update channel yet.

Please update manually and let me know if the issue persists. https://github.com/FellippeHeitor/InForm/archive/refs/heads/development.zip - You will need to unpack everything and compile UiEditor.bas (uncheck "output exe to source folder" in the IDE).

This is the commit for that issue, see if it makes sense: https://github.com/FellippeHeitor/InForm/commit/12a67c804674e6318c969061fbeb34a41fc6209d
« Last Edit: June 29, 2021, 07:55:22 AM by FellippeHeitor »

Offline Qwerkey

  • Forum Resident
  • Posts: 764
Re: Strange Behaviour of RemoveItem
« Reply #2 on: June 29, 2021, 07:53:20 AM »
OK.  Will try that.  Also had some other oddities with ListBox methods.  I'll get a bit further with the coding and place .frm & .bas here.

Offline FellippeHeitor

  • QB64 Developer
  • Forum Resident
  • Posts: 3064
  • Let it go, this too shall pass.
    • QB64.org
Re: Strange Behaviour of RemoveItem
« Reply #3 on: June 29, 2021, 07:56:31 AM »
😬

Offline Qwerkey

  • Forum Resident
  • Posts: 764
Re: Strange Behaviour of RemoveItem
« Reply #4 on: June 30, 2021, 04:56:14 AM »
A further oddity.  DATA/READ appears not to work correctly (lines 60 & 61).
Instead of reading/printing the DATA lines (last lines of the .bas), attributes of a form object are READ.  See temp file "today.txt" created on run.

  

An old Inform project with DATA/READ lines works correctly.
What stupid thing have I done now?  I said I was rusty: totally incompetent by the look of things.  Sorry for the necessary spoon-feeding.

Offline FellippeHeitor

  • QB64 Developer
  • Forum Resident
  • Posts: 3064
  • Let it go, this too shall pass.
    • QB64.org
Re: Strange Behaviour of RemoveItem
« Reply #5 on: June 30, 2021, 08:10:55 AM »
InForm has its own DATA fields for internal use. Place your data fields in the main module, before the first $includes, identify them with a label and use RESTORE before using READ.

Offline Qwerkey

  • Forum Resident
  • Posts: 764
Re: Strange Behaviour of RemoveItem
« Reply #6 on: June 30, 2021, 09:44:47 AM »
From the behaviour, I assumed that this is what has happened.  Forgot about the RESTORE method.  Thanks.

Offline Qwerkey

  • Forum Resident
  • Posts: 764
Re: Strange Behaviour of RemoveItem
« Reply #7 on: July 03, 2021, 05:20:24 AM »
Another beginner's question (Odin ought to reset my status to Newbie, or new category "Shouldn't Be Here At All"):

When a ListBox Item has been clicked, it becomes highlighted (selected).  At present, when I click out of the ListBox to somewhere else, the last selected item remains highlighted.  Is there a way to change the displayed highlight property back to unselected?