|
I have a Visual Basic6.0 application, which uses alorithms to calculate the results for one particular device. Everytime i have a minor changes in the Algorithm to have a different device. Example a device with some added features or removed features, this cannot be generalized to have a feature selections in the GUI as there may be a different device itself.
My question is it possible to have a Algorithm as a macro in my VB 6.0 Application(such as excel marcos), this way I need not change the execuatable everytime I can only change the marco. Or Is it possible to write a algorithm in a text file which will read the file as source code and behave the application as it is written in the text file?
|
|
|
|
|
If it is at all possible for you to not use vb6, it is possible in .NET:
See this article[^] which does it in C#.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hello every one,
I am working on a Vb.net 2005 application. I came across two ways to declare a array, i just wanted to know is there any difference between them
Dim iTestArray() As Integer
and
Dim iTestArray As Integer()
Regards
Nishkarsh
|
|
|
|
|
|
First of all, an Array isn't the same as an Integer . An Integer can't hold multiple values. To dim an array you should use the following:
Dim ArrayName As Array
Or:
Dim ArrayListName As New ArrayList
The difference between these two is (again, as far as I know ) that the size of the ArrayList is dynamically increased when needed, and that the (regular) Array doens't do this.
Cheers,
Zaegra
Motivation is the key to software development.
|
|
|
|
|
Nishkarsh's original array declarations are absolutely correct.
Your method of declaring it as 'Array' (System.Array) is generally the wrong thing to do. Declaring a variable of type 'Array' is a special purpose technique that is rarely required.
David Anton
http://www.tangiblesoftwaresolutions.com
Convert VB to C#, C++, or Java
Convert C# to VB, C++, or Java
Convert C++ to C#, VB, or Java
Convert Java to C#, C++, or VB
|
|
|
|
|
Then please explain to me how I can store multiple values in an Integer? Because as far as I know an integer is just a number?
Motivation is the key to software development.
|
|
|
|
|
You can't store multiple values in an Integer.
This is just the syntax you use when declaring arrays.
i.e.,
Dim i() As Integer
or
Dim i As Integer()
The parenthesis pair after either the identifier or the type indicates that it's an array of Integer, not a single Integer.
David Anton
http://www.tangiblesoftwaresolutions.com
Convert VB to C#, C++, or Java
Convert C# to VB, C++, or Java
Convert C++ to C#, VB, or Java
Convert Java to C#, C++, or VB
|
|
|
|
|
Zaegra wrote: how I can store multiple values
Dim MyMixedValueArray() As Object
or
Dim MyMixedValueArray As Object()
My advice is free, and you may get what you paid for.
|
|
|
|
|
I agree with David Anton.
Example:
'Declare the array:
Dim myIntArray(2) as Integer
myIntArray(0) = 9
myIntArray(1) = 8
myIntArray(2) = myIntArray(0) - myIntArray(1) 'The value becomes 1 (9 - 8)
That's how it's used.
-Ray
|
|
|
|
|
Hi all,
Currently i am facing a problem when i try to insert rows in a table dynamicly. i using vb.net 2008 with mssql express 2008.here are the details of my codes
USE [database]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create PROCEDURE [dbo].[TestSp]
(
@name nvarchar(50),
@tb varchar(200)
)
AS
BEGIN
SET NOCOUNT ON;
execute ('insert into ' + @tb +'(xname)values(@name)')
END
exec testsp 'testtable1','Abcxyz'
Error: Msg 137, Level 15, State 2, Line 1
Must declare the scalar variable "@name".
please help me.
rmshah
Developer
|
|
|
|
|
Notice how you included the table name in the SQL string, do the same for the @Name value as well.
execute ('insert into ' + @tb +'(xname)values(' + @name +')')
Also use pre tags when posting code - easier to read
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
output the first 10 prime number
gift
|
|
|
|
|
I know how to do that one: Console.WriteLine("2 3 5 7 11 13 17 19 23 29")
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
OK, now do the first ten Happy Primes!
All Right, I will...
7, 13, 19, 23, 31, 79, 97, 103, 109, 139
------------------------------------
"Possessions make you poor, wealth is measurable only in experience."
Sun Tzu 621BC
|
|
|
|
|
13 is not and never will be a happy prime number
TonyMac
|
|
|
|
|
I'm happy with 13
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
I have to say, however, that my reasoning for 13 being unhappy is in no way scientific.
TonyMac
|
|
|
|
|
tonym001 wrote: the day the Knights Templar were slaughtered
I don't know them, the only knights I know say ni ny.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
modified on Friday, May 15, 2009 5:25 PM
|
|
|
|
|
nee not ni
TonyMac
|
|
|
|
|
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I always understood that it was because there were thirteen at the last supper.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
You might want to look into the sieve of Eratosthenes, and if you wanted to go a little further, throw wheel factorisation into the mix
|
|
|
|