[SOLVED] ForEach is a Syntax error -- WHAT?!!!

Just starting out? Need help? Post your questions and find answers here.
Randy Walker
Addict
Addict
Posts: 1170
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA
Contact:

[SOLVED] ForEach is a Syntax error -- WHAT?!!!

Post by Randy Walker »

This is a slightly modified Sample from ListViewGadget() help. Modified to try to figure out why ForEach is a syntax error. I got nowhere:

Code: Select all

NewList Test.s()
For a = 1 To 12
  AddElement(Test())
  Test() = "Item " + Str(a) + " of the Listview"
  Debug Test()
Next

If OpenWindow(0, 0, 0, 270, 140, "ListViewGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ListViewGadget(0, 10, 10, 250, 120)
  ForEach
    AddGadgetItem Test()
  Next
  SetGadgetState(0, 9) ; set (beginning with 0) the tenth item as the active one
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

Last edited by Randy Walker on Wed Nov 05, 2025 1:21 am, edited 1 time in total.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Randy Walker
Addict
Addict
Posts: 1170
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA
Contact:

Re: ForEach is a Syntax error -- WHAT?!!!

Post by Randy Walker »

Ok, Again. stupid me. I didn't quite finish these two lines:

Code: Select all

  ForEach Test()
    AddGadgetItem(0,-1,Test())
Sorry to bother you. :oops:
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Post Reply