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

0 Members and 1 Guest are viewing this topic.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
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


FellippeHeitor

  • Guest
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: 755
    • View Profile
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.

FellippeHeitor

  • Guest
Re: Strange Behaviour of RemoveItem
« Reply #3 on: June 29, 2021, 07:56:31 am »
😬

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
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.

FellippeHeitor

  • Guest
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: 755
    • View Profile
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: 755
    • View Profile
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?