Search found 1215 matches

by jj2007
Nov 29, 2017 18:27
Forum: General
Topic: POINTER NULL CHECK
Replies: 41
Views: 1588

Re: POINTER NULL CHECK

Btw it's not trivial whether true=1 or true=-1 or something else. Micros**t has introduced true=1, unfortunately, because with true=-1 you could 'confirm' values as in MyVal=123 and (a<b) ' 123 if true, 0 if false My defunct favourite dialect Gfa returned the full source string for Left$("some ...
by jj2007
Nov 29, 2017 14:58
Forum: General
Topic: Code timimg ( Part I )
Replies: 51
Views: 1860

Re: Code timimg

Earlier, jj2007 wrote "The strategy to follow here is: Make a hundred runs, sort them, then eliminate the slowest runs until you reach the zone where you get constant results." The point being that, because of system activity, there will probably be some tests coming in slow. I've refined...
by jj2007
Nov 28, 2017 13:50
Forum: General
Topic: Code timimg ( Part I )
Replies: 51
Views: 1860

Re: Code timimg

deltarho[1859] wrote:Can you see a bell curve shaping up?

No, I can't see a bell curve. I see a very specific one...:
Image
by jj2007
Nov 28, 2017 11:41
Forum: General
Topic: Code timimg ( Part I )
Replies: 51
Views: 1860

Re: Code timimg

The strategy to follow here is: Make a hundred runs, sort them, then eliminate the slowest runs until you reach the zone where you get constant results. I used to do that - "laboratory conditions" I called it. However, if we plan using the 'conditioned' timings we must remember that the s...
by jj2007
Nov 28, 2017 7:40
Forum: General
Topic: Code timimg ( Part I )
Replies: 51
Views: 1860

Re: Code timimg

But I remember that these confidence intervals always assume an underlying normal distribution. (They have to, what else is there?) The "else" is called "cpu" ;-) There is a processor struggling hard to give you the fastest response possible. And it works in cycles. If an algo n...
by jj2007
Nov 27, 2017 12:37
Forum: General
Topic: POINTER NULL CHECK
Replies: 41
Views: 1588

Re: POINTER NULL CHECK

fxm wrote:It always returns an Integer

Yep! Funny, isn't it? Not true or false but rather a number...
by jj2007
Nov 27, 2017 10:04
Forum: General
Topic: POINTER NULL CHECK
Replies: 41
Views: 1588

Re: POINTER NULL CHECK

As the disassembly above shows, the compiler doesn't bother to translate that to a boolean or integer value It does when a return value from the evaluation is requested. That is correct (avoiding to write 'true'), but what does it return: An integer or a boolean? Take a little test... Dim result as...
by jj2007
Nov 26, 2017 23:09
Forum: General
Topic: POINTER NULL CHECK
Replies: 41
Views: 1588

Re: POINTER NULL CHECK

So testing IF LEN(string) THEN returns TRUE if the outcome is non-zero. It is up to a compiler to translate that to -1 or anyting other than zero. ;) As the disassembly above shows, the compiler doesn't bother to translate that to a boolean or integer value; it translates to jz skipthis ; jump if z...
by jj2007
Nov 26, 2017 21:15
Forum: General
Topic: POINTER NULL CHECK
Replies: 41
Views: 1588

Re: POINTER NULL CHECK

'Len (string)' is neither true nor false, but conversely 'Len (string) = 0' is true or false. I suspect it's just a habit. In one of my older sources I find 200 instances of IF LEN(some$), only two have IF LEN(some$)>0. One is IF LEN(a$)>0 AND LEN(b$)>0 THEN ... Actually, omitting the >0 might pose...
by jj2007
Nov 26, 2017 20:46
Forum: General
Topic: POINTER NULL CHECK
Replies: 41
Views: 1588

Re: POINTER NULL CHECK

Another example, I don't like the syntax: If Len(string) Then ... Dim MyString as string="123" asm int 3 if len(MyString) Then print "ifLen" endif asm int 3 if len(MyString)>0 Then print "ifLenGtzero" endif Address Hex dump Command Comments 0040161B ³. CC int3 0040161C...
by jj2007
Nov 26, 2017 16:31
Forum: General
Topic: POINTER NULL CHECK
Replies: 41
Views: 1588

Re: POINTER NULL CHECK

When compiling with gcc, complement a pointer is disallowed (works with gas). gcc is stricter (or gas more lax) The problem is maybe that some programmers don't pay much attention to the consequences: Dim handleI as integer Dim handleB as boolean handleI=123 handleB=123 if not handleI then print &q...
by jj2007
Nov 26, 2017 12:50
Forum: Beginners
Topic: Copy FB .csv file to Base table
Replies: 3
Views: 604

Re: Copy FB .csv file to Base table

Have you tried copying a tab-delimited text instead?

P.S.: There is a csv test file attached to this post.
by jj2007
Nov 26, 2017 12:41
Forum: General
Topic: POINTER NULL CHECK
Replies: 41
Views: 1588

Re: POINTER NULL CHECK

This works fine for me: dim handle as any ptr if handle = 0 then Print "NULL" if not handle then Print "Handle="; handle handle=1 if handle = 0 then Print "NULL" if not handle then Print "Handle="; handle Sleep Output: NULL Handle=0 Handle=1 Check also the out...
by jj2007
Nov 25, 2017 23:07
Forum: General
Topic: QuickSort Text
Replies: 3
Views: 327

Re: QuickSort Text

For position 11, ascending, your last code produces this - is that the intended result? alemania berlin freuiweuiweiu austria viena oihgijhvygctfs china pekin zxcxcvxc dinamarca copenague asgsdfgfsgdfgd francia paris abcdefghijklmno grecia atenas piuoiutuyyt inglaterra londres sdfsarbfbwshifb italia...
by jj2007
Nov 23, 2017 15:14
Forum: General
Topic: How non-random was QB's RND
Replies: 40
Views: 1504

Re: How non-random was QB's RND

Here is the code from C Diagonal patterns as well... Here is one with a switch: useMb=1 uses the MasmBasic Rand() algo. For useMb=0, you get QB. The result is pretty clear but have a closer look... const maxloops= 20000000 const useMb= 1 Static Shared As Long MasmBasicSeed=&h6f616943 Function M...

Go to advanced search