Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant handle a Control Array as a Collection #1239

Closed
dmrvb opened this issue Oct 8, 2022 · 9 comments
Closed

Cant handle a Control Array as a Collection #1239

dmrvb opened this issue Oct 8, 2022 · 9 comments

Comments

@dmrvb
Copy link

dmrvb commented Oct 8, 2022

Describe the bug
In VB6 a Control Array can be treated like a Collection, in tB it gives an error: Missing Argument "index"

To Reproduce

  1. Create an array of optionbuttons "OptB" on a form
  2. Do this code:
    Dim O as OptionButton
    For each O in Form1.OptB
    next

This gives the error

Expected behavior
To be compatible with VB6 this should work.

Also
Cut and paste of controls in Form Designer does not give option to create a control array, this is a useful VB6 feature
(I should start a new issue for this but think this just might have been raised????)

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Windows 11]
  • twinBASIC compiler version [143]

Additional context
Add any other context about the problem here.

@dmrvb
Copy link
Author

dmrvb commented Oct 9, 2022

Probably not, 933 is Forms collection missing.
Most collection stuff is working (Thank you Wayne) including the controls collection, this bug relates to control arrays referenced as a collection.
note trhat this works fine.....
dim c as control
for each C in controls

@WaynePhillipsEA
Copy link
Collaborator

Fixed in BETA 144, thanks!

@dmrvb
Copy link
Author

dmrvb commented Oct 9, 2022

Still not working here.
Now gives error:
Unrecognised member 'optionbuttonName' on ' _Type FormName' [non extensible object]
Type {unresolved} is an unsupported datatype for For-Next

@WaynePhillipsEA
Copy link
Collaborator

Apologies, the member is now private by accident. If you access the collection from within the class (i.e. Me.OptB) it should work. I'll get that fixed tomorrow.

@dmrvb
Copy link
Author

dmrvb commented Oct 9, 2022

Yes, crossed posts, just found that. Thanks.

@WaynePhillipsEA
Copy link
Collaborator

This should onw be fixed in BETA 145. Any problems, just let me know ;)

@dmrvb
Copy link
Author

dmrvb commented Oct 9, 2022

That works, thank you, another compile error fixed.
Would a list of all errorsstill preventing compilation be of any use to you, or shall I wait a bit longer? I think you are aware of most of them.
From my perspective tB really has moved forward a lot in the last few weeks and a full import and compile feels very close now.

@WaynePhillipsEA
Copy link
Collaborator

WaynePhillipsEA commented Oct 9, 2022

You're welcome, and thanks for reporting these things. If you could open GitHub issues for any you find that are not covered by other issues, that would be great. If everything is already covered, then no need as I will get to them soon (particularly if they are UI related).

I don't mind pings/bumps on existing issues to bring them back to my attention... particularly if you can see that I'm working in a related area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@WaynePhillipsEA @dmrvb and others