QB64.org Forum

QB64 Team Software => InForm Discussion => Topic started by: Qwerkey on June 29, 2021, 05:44:04 am

Title: Strange Behaviour of RemoveItem
Post by: Qwerkey 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

Title: Re: Strange Behaviour of RemoveItem
Post by: FellippeHeitor 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
Title: Re: Strange Behaviour of RemoveItem
Post by: Qwerkey 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.
Title: Re: Strange Behaviour of RemoveItem
Post by: FellippeHeitor on June 29, 2021, 07:56:31 am
😬
Title: Re: Strange Behaviour of RemoveItem
Post by: Qwerkey 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.

  [ This attachment cannot be displayed inline in 'Print Page' view ]    [ This attachment cannot be displayed inline in 'Print Page' view ]  

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.
Title: Re: Strange Behaviour of RemoveItem
Post by: FellippeHeitor 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.
Title: Re: Strange Behaviour of RemoveItem
Post by: Qwerkey 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.
Title: Re: Strange Behaviour of RemoveItem
Post by: Qwerkey 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?