Page 1 of 1

Using CountGadgetItems on a editorgadget

Posted: Mon Sep 09, 2024 8:26 am
by Stefan
Is there no CountGadgetItems(), if i use a editorgadget in Spiderbasic?

Re: Using CountGadgetItems on a editorgadget

Posted: Mon Sep 09, 2024 9:08 am
by Fred
No, it's not supported. You can still get the whole text and count the LF$, it should work.

Re: Using CountGadgetItems on a editorgadget

Posted: Mon Sep 09, 2024 9:11 am
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

Re: Using CountGadgetItems on a editorgadget

Posted: Mon Sep 09, 2024 9:32 am
by Stefan
Thank you very much!
Unfortunately, this is of no use to me if I want to count text breaks.