Qbasicnews.com

Full Version: Combinatorics Algorithm
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I see. I tested it. Good work.

BTW,
The reason I came up with this challenge is because I was trying to split up 1300 megabytes or so to make them fit on two CDs.. took me a bit of time to come up with the right files for each CD..

PS:
"byval" in a QB sub prolly works in 7.1, but I'm not sure if it works in 4.5. I got rid of the BYVALs (because I couldn't start the program with 'em) and put in each sub call the Total variable in parentheses, which accomplishes the same thing.
Quote:PS:
"byval" in a QB sub prolly works in 7.1, but I'm not sure if it works in 4.5. I got rid of the BYVALs (because I couldn't start the program with 'em) and put in each sub call the Total variable in parentheses, which accomplishes the same thing.

Just wondering, what does byval do anyways.
Quote:Just wondering, what does byval do anyways.

Explained in QB help.

Code:
BYVAL Clause

Syntax
  BYVAL variable [AS type]

The BYVAL attribute in the parameter list of a DECLARE statement causes
the value of the specified variable to be passed to the procedure, rather
than the variable's address. BYVAL can only be used in DECLARE statements
for non-BASIC procedures, and cannot be applied to string parameters.
I realize that this is old, but I have been busy for a while.

In 7.1 BYVAL can be used by BASIC as well as non-BASIC procedures. It has two advantages:

1) Since it only passes the value, The variable in the calling procedure isn't changed.


2) Variables in the calling and called procedure don't have to be the same type. This saves having to rewrite procedures for different variable types.
Oh great...

Another reason to use qb7.1... :evil: [/i]
Pages: 1 2