Using CountGadgetItems on a editorgadget

Just starting out? Need help? Post your questions and find answers here.
Stefan
Posts: 248
Joined: Mon Feb 05, 2018 9:44 pm

Using CountGadgetItems on a editorgadget

Post by Stefan »

Is there no CountGadgetItems(), if i use a editorgadget in Spiderbasic?
Fred
Site Admin
Posts: 1820
Joined: Mon Feb 24, 2014 10:51 am

Re: Using CountGadgetItems on a editorgadget

Post by Fred »

No, it's not supported. You can still get the whole text and count the LF$, it should work.
User avatar
Peter
Posts: 1197
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Using CountGadgetItems on a editorgadget

Post by Peter »

Code: Select all

If OpenWindow(0, 0, 0, 322, 150, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  EditorGadget(0, 8, 8, 306, 133)
  SetGadgetText(0, "This is a multiline text to edit" + #LF$ +
                   "in the EditorGadget()." + #LF$ +
                   "Third line")
  Debug CountString(GetGadgetText(0), #LF$) + 1
EndIf
Stefan
Posts: 248
Joined: Mon Feb 05, 2018 9:44 pm

Re: Using CountGadgetItems on a editorgadget

Post by Stefan »

Thank you very much!
Unfortunately, this is of no use to me if I want to count text breaks.
Post Reply