[Implemented] Bug in GetGadgetText() !?

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

[Implemented] Bug in GetGadgetText() !?

Post by BackupUser »

Restored from previous forum. Originally posted by teachco.

Hello,

it is not possible to write a text ( > 5 kByte ) to the file on disk.
I think the problem is a limitation in StringGadget or a bug in GetGadgetText(). What's wrong?

...
If CreateGadgetList(WindowID())
Textbox=StringGadget(0, 3, 0, breite-5, hoehe-
23, "",#PB_String_Multiline|#ES_AUTOVSCROLL|#WS_VSCROLL
|#WS_HSCROLL)
EndIf
...

If File$
#Gadget = 0
Text$ = GetGadgetText(#Gadget)
#Datei = 2
Result = CreateFile(#Datei, File$)
If Result 0
#Memory = 2
If AllocateMemory(#Memory, Len(Text$), 0)
*Pointer = MemoryID()
PokeS(*pointer, Text$, Len(Text$))
WriteData(*pointer, Len(Text$))
CloseFile(#Datei)
EndIf
EndIf
MessageRequester("Information", "Die aktuelle Datei"+Chr(13) +File$+Chr(13)+"wurde gesichert.", 0)
EndIf
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by freak.

This was an old limitation for the StringGadget.
Fred knows it, and I think it is fixed.

You can use the GetWindowText_() API as a workaround.

Timo
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

This is fixed, yes.

Fred - AlphaSND
Post Reply