Search found 1016 matches

by jevans4949
Sep 26, 2015 13:30
Forum: Community Discussion
Topic: second rnd sequence
Replies: 8
Views: 1274

Re: second rnd sequence

@St_W: Your suggestion is good, and could also be thread-safe. One would probably want to set up a class for the state variable(s?), with the data specified as private, to discourage VW programmers from poking it.
by jevans4949
Sep 26, 2015 10:58
Forum: Community Discussion
Topic: second rnd sequence
Replies: 8
Views: 1274

Re: second rnd sequence

@MichaelW: This is not what the OP is looking for. What he wants is to be able to generate two random number series at the same time. Precisely why, I don't know. The obvious solution is to modify the static variables of the existing random number generators to arrays of some finite size, and modify...
by jevans4949
Sep 19, 2015 22:20
Forum: Community Discussion
Topic: Hello Admin I use this forum as guest since 1970 !!!
Replies: 6
Views: 1017

Re: Hello Admin I use this forum as guest since 1970 !!!

Isn't that the zero time for the Unix clock? Thought that didn't loop round until 2035 sometime?
by jevans4949
Aug 10, 2015 21:38
Forum: General
Topic: Ancestors
Replies: 5
Views: 657

Re: Ancestors

Of course, it doesn't allow for the fact that in small communities people marry (sometimes distant) cousins, so the further back you go, there is more chance of duplication. I thought I read recently that 9% of men in Asia are descended from Genghis Khan. Also, someone did some genetic research on a...
by jevans4949
Jul 26, 2015 7:40
Forum: General
Topic: Making compact number representation
Replies: 13
Views: 1024

Re: Making compact number representation

You may be interested in the variable-length integer format used by MIDI files. This is a big-endian format, with 7 bits of data and the senior bit set on if there are more bytes to follow. The following decodes one to an integer. '********************************************************************...
by jevans4949
Jul 26, 2015 6:57
Forum: Community Discussion
Topic: FB1.03.0-win32 Seg Violation
Replies: 3
Views: 697

Re: FB1.03.0-win32 Seg Violation

Somebody else can explain the compiler error ... You can't (apparently) stop Microsoft adding new identifiers to the Windows api. When I started programming, each project the organisation worked on had a two-letter project code, and all identifiers had to begin with that. Each project had sub-projec...
by jevans4949
Jul 26, 2015 6:12
Forum: Community Discussion
Topic: Downside of using FreeBASIC
Replies: 17
Views: 2097

Re: Downside of using FreeBASIC

This is always a problem for any large organisation which develops projects using "niche" languages. It's why IBM is still able to sell hardware; banks and other large businesses have invested millions in applications developed in its assembler and language dialects over 50 years, and can'...
by jevans4949
Jul 25, 2015 22:31
Forum: Beginners
Topic: Name
Replies: 7
Views: 833

Re: Name

IMO, it's best to avoid using as a variable name anything that MIGHT be, or become, a keyword. So call your variable xname, or pname, or something like that.
by jevans4949
Jul 25, 2015 22:16
Forum: Beginners
Topic: money format
Replies: 12
Views: 1104

Re: money format

Years ago I worked on a currency exchange application in New York where rates were quoted with a variable number of decimal places followed by a fraction with a denominator in up to 64ths, e.g., 1.325 and 17/32. (=1.32553125) AFAIR we just converted it to 8 decimal places to do the actual calculatio...
by jevans4949
Jul 25, 2015 21:26
Forum: Beginners
Topic: Ubyte and negative step in 'For' loop [Solved]
Replies: 21
Views: 1118

Re: Ubyte and negative step in 'For' loop [Solved]

By the way, there is a thing in the compiler to prevent the use of constants out of range for the data type. So: For i As ubyte = -1 To 300 - will throw up: warning 25(0): Overflow in constant conversion Also, the following type of logic may be useful to you at some point in your career. Dim mytable...
by jevans4949
Jul 25, 2015 21:08
Forum: Beginners
Topic: money format
Replies: 12
Views: 1104

Re: money format

Typically, financial applications should hold monetary amounts in cents, to preserve accuracy. When you need to print them, use the STR function to covert, then edit to put in the necessary leading zeros and decimal point. If calculating sales tax, or interest, make sure you follow any local rules f...
by jevans4949
Jul 25, 2015 20:35
Forum: Beginners
Topic: Ubyte and negative step in 'For' loop [Solved]
Replies: 21
Views: 1118

Re: Ubyte not compatible with negative step in For loop?

This comes up quite often. The way a for-loop works is that at the end of the loop the counter is incremented (or in this case decremented) in accordance with the STEP clause, then tested to see if it has surpassed the TO value, in the relevant direction. FB does not test or report for overflow/unde...
by jevans4949
Jul 12, 2015 22:06
Forum: Beginners
Topic: Converting old code
Replies: 18
Views: 1816

Re: Converting old code

If you are using TYPEs containing STRING*n, be aware that STRING* is not implemented in FreeBasic as in MS Basics. E.g. STRING*8 takes 9 bytes, the last being a null character; FB treats it more like a ZSTRING It's best redefine as ZSTRING*8, and change attempts to access it to LEFT$(mystring,8). If...
by jevans4949
May 26, 2015 23:31
Forum: Beginners
Topic: var-len??
Replies: 8
Views: 944

Re: var-len??

OK, I did the calculationbefre posting, and yes it comes to 1.6-and-a-bit Terabyes; I decided 1.6 was good enough to point up the problem for sanyone with an avearge PC. @Luis Babboni: You probably need to think about a sparse array. The principle with that is that the top 5 levels of the array are ...
by jevans4949
May 25, 2015 3:28
Forum: Beginners
Topic: var-len??
Replies: 8
Views: 944

Re: var-len??

I make that 1.6 terabytes of array ... how big is your RAM?

Go to advanced search