Page 2 of 4 <1234>
Topic Options
#106251 - 2003-10-29 11:48 PM Re: POLL: String Expressions
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Not sure why people are guessing 32Kb because we all know it is much bigger than that ... I will toss my hat into the ring and guess the following:

2,147,483,648

Top
#106252 - 2003-10-29 11:50 PM Re: POLL: String Expressions
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
That was my guess as well. Unfortunately I do not have the memory to test it.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#106253 - 2003-10-29 11:51 PM Re: POLL: String Expressions
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Was this your guess, or did you guess the number in the survey, which is one less.
Top
#106254 - 2003-10-29 11:57 PM Re: POLL: String Expressions
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Details, details. The number in the survey was my guess.

This is the output from my test program so far. The value is length of the string.

10240
20480
40960
81920
163840
327680
655360
1310720
2621440
5242880
10485760
20971520
41943040
83886080
167772160
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#106255 - 2003-10-30 12:01 AM Re: POLL: String Expressions
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Just teasing ... but other than Ruud, who knows the answer ... Jens, do you know the answer ?

[edit]

Oh yeah, do we get a KORG t-shirt if we're right ?

[ 30. October 2003, 00:04: Message edited by: Shawn ]

Top
#106256 - 2003-10-30 12:05 AM Re: POLL: String Expressions
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
It is big but I do not have the memory or time at home to test it. Shawn's guess sounds reasonable but so do all the last 3 suggestions offered by jens.
_________________________
Jack

Top
#106257 - 2003-10-30 12:10 AM Re: POLL: String Expressions
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Last output...
335544320

Computer is crawling everything is being done in virtual memory...

[ 30. October 2003, 00:14: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#106258 - 2003-10-30 12:10 AM Re: POLL: String Expressions
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
I used this:

code:
Break on
$a='a'
$i=1.0
While 1
$a=$a+'a'
$i=$i+1
? $a ? $i
If $i > 32000
Play "1g256t1d500f1g256t1d400f1g256t1d600f"
Get $x
EndIf
Loop

wait for the beep, scroll a little upwards and see that after 31920 the string isn't displayed anymore...

Anyone know why??

[ 30. October 2003, 00:11: Message edited by: MightyR1 ]
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#106259 - 2003-10-30 12:12 AM Re: POLL: String Expressions
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Same results here using Howard's code (first post 167772160). Stopped at this score cause the performace became realy bad.
So Howard's code sort of proved that my code s#@$cks [Roll Eyes]

Kix32.exe using almost 300 MB of memory [Eek!] LOL [Big Grin]

[ 30. October 2003, 00:17: Message edited by: R2D2 ]
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#106260 - 2003-10-30 12:13 AM Re: POLL: String Expressions
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
STDOUT limitation?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#106261 - 2003-10-30 12:20 AM Re: POLL: String Expressions
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
ok then no string output...

sofar: 268435456
using
code:
Break on
$a='a'
While 1
$a=$a+$a
? 'len = ' Len($a)
loop



[ 30. October 2003, 00:24: Message edited by: MightyR1 ]
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#106262 - 2003-10-30 12:29 AM Re: POLL: String Expressions
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
one of the interesting problems - when one does hit the max string size - the script will probably crap with an expression too long error and you will never be able to capture that last accurate count.
Top
#106263 - 2003-10-30 12:38 AM Re: POLL: String Expressions
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
I put in a print to file every 1000th loop plus I checked the error code immediately after the extension figuring it might keep going but put out an error code. Into about a million, I got nothing.
_________________________
Jack

Top
#106264 - 2003-10-30 12:38 AM Re: POLL: String Expressions
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
I have not been paying attention to my output [Frown]

Just looked and it returned lengths of 0...

Will run again with get $x...

Funny:  -
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#106265 - 2003-10-30 12:49 AM Re: POLL: String Expressions
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
I tried something like this but so far got nothing.

code:
redirectoutput("d:\kixgolf\kixstr.txt",1)
dim $a, $b, $c, $d
$a=1
$b='d'
DO
$a=$a+1
$b=$b+'d'
$d=@error
$c=$a/1000
if ($a=1000*$c)
? $a
endif
UNTIL $a=2147483648 or $d<>0 or len($b)<>$a
? ' *** stopped *** ' $a

_________________________
Jack

Top
#106266 - 2003-10-30 01:01 AM Re: POLL: String Expressions
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
String with length 268435456 added with same string gave me a new length of zero!!!
This was on a P4, 2.8 GHz with 512 MB RAM

Will now run on a P2, 400 Mhz with 192 MB RAM
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#106267 - 2003-10-30 01:07 AM Re: POLL: String Expressions
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Next Q...

is my previous result the max value of a string expression, or is it the max 'len' can handle???

How to test this???
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#106268 - 2003-10-30 01:14 AM Re: POLL: String Expressions
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Use SPLIT and ubound.

Build a string of a million byte and add a delimiter. Then when Length goes to "0" split the string and check ubound.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#106269 - 2003-10-30 01:14 AM Re: POLL: String Expressions
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
P2 results using
code:
Break on
$a='a'
While 1
$a=$a+$a
? 'Len = ' Len($a)
Get $x
Play '1g256t1d500f'
? 'Running...'
Loop

gave me
code:
Len = 2
Running...
::
::
::
Len = 67108864
Running...
Len = 134217728
Running...
ERROR : out of memory!
Script: D:\Temp\tst.kix
Line : 4

Looking at this, maybe the RAM determines the limit???

Can't test more @home, will try at work if time allows [Wink]
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#106270 - 2003-10-30 01:30 AM Re: POLL: String Expressions
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
I am not sure but I don't think there is any limit what so ever. I just ran this code

code:
redirectoutput("d:\kixgolf\kixstr.txt",1)
dim $i, $e, $str
$i=1
$str='x'
DO
$i=4*$i
$str=$str+$str+$str+$str
$e=@error
? $i
UNTIL $e<>0 or len($str)<>$i
? ' *** stopped *** ' $i

and it seemed to effectively stop at$i=67,108,864. At this point I was using amost all my physical memmory & almost all my virtual memory & nothing was happening. When I tried opening other apps to see if I could find out what was happening the system became unstable & started shutting down apps & trying to reboot. at this point my best guess is it corrupted the virtual memory file because I keep getting a disk check error on reboot. Fortunately, my machine is dual boot & I was able to do a diskcheck from the 2nd version & rectify the problem.
_________________________
Jack

Top
Page 2 of 4 <1234>


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 507 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.082 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org