***SOLVED*** StringGadget() fails for text len > 2500

Just starting out? Need help? Post your questions and find answers here.
Tomio
Enthusiast
Enthusiast
Posts: 291
Joined: Sun Apr 27, 2003 4:54 pm
Location: Germany

***SOLVED*** StringGadget() fails for text len > 2500

Post by Tomio »

****************************************************************************
the problem described below vanished after reboot!
I didn't shut down the PC for about 10 days. I prefer "standby" instead.
Just now it occurred to me to try a reboot ... and... everything is ok.
Sorry for havn't thought of this earlier.
!!Thanks for your answers!!
****************************************************************************

Does someone has an idea? --> StringGadget() fails.

The following code runs on my WIN7 (32bit) at least up to teststring len=99999 .
But on my XP the initialization of the StringGadget() fails for text len > 2500 (even earlier)

The XP PC is a new one.
On my previous XP PC there was no such problem up to at least 60000 characters.
I know this because the program in question is used to read in a textfile of this size.
The program is in use since years.

So this shouldnt be a problem of PB. But perhaps someone has an idea?
PB = 4.51

Code: Select all

NL.s=Chr(13)+Chr(10)
iz=Val(InputRequester("Enter Stringlength for StringGadget:","","0"))
If iz=0: End:EndIf
;
;make lines of 100 characters each:
i1=iz/100: 
i2=iz-i1*100 
For i=1 To i1: 
  v1+100:v$=Right("00000"+Str(v1),5)     ;character counter
  u$=u$+Space(92)+v$+"X"+NL: 
Next
If i2>0: u$=u$+Space(i2-1)+"X": EndIf 
;
flag=#ES_MULTILINE |#PB_String_ReadOnly  | #WS_VSCROLL;
  If OpenWindow(0, 0, 0, 422, 220, "StringGadget Flags", #PB_Window_SystemMenu )
    StringGadget(0, 8,  10, 406, 200, u$,flag)
    MessageRequester("QQ","len="+Str(Len(u$))+", IsGadget="+Str(IsGadget(0)))
    If IsGadget(0) = 0: End: EndIf
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
Thanks for help tomio
Last edited by Tomio on Sun Mar 27, 2011 11:00 am, edited 1 time in total.
case
Enthusiast
Enthusiast
Posts: 141
Joined: Thu Aug 07, 2003 11:09 am

Re: StringGadget() fails for text len > 2500

Post by case »

tried stringgadget up to 500000 and it worked ( had to adapt the code a bit for 6 digits instead of 5)
User avatar
GeBonet
Enthusiast
Enthusiast
Posts: 135
Joined: Fri Apr 04, 2008 6:20 pm
Location: Belgium

Re: StringGadget() fails for text len > 2500

Post by GeBonet »

Also tried and all Ok to 25000... :wink:
Sorry for my english :wink: ! (Windows Xp, Vista and Windows 7, Windows 10)
Tomio
Enthusiast
Enthusiast
Posts: 291
Joined: Sun Apr 27, 2003 4:54 pm
Location: Germany

Re: StringGadget() fails for text len > 2500

Post by Tomio »

as I said: probably it's not due to PB.

Perhaps someone has an experience of this kind?
I mean: PB wrongdoing(?) on one PC.

..tomio
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: StringGadget() fails for text len > 2500

Post by c4s »

Maybe you can increase the allowed count of characters. Take a look at EM_LIMITTEXT: http://msdn.microsoft.com/en-us/library ... 85%29.aspx
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Post Reply