|
Do you mean to assign objects to the array, simply do this
array1(0) = "Hello"
array1(1) = "world"
If you mean to increase the capacity of the array, use the Redim keyword
Redim Preserve array1(10)
array1(9) = "Bye"
Sig Under Construction. Visit back later.
Support Bone
|
|
|
|
|
I want to assign objects to the array. However I need to do this dynamically as they type information in.
I can't get the code right for the program to add the new string to the end of the array.
|
|
|
|
|
Post a code snippet so we can see what you are doing. The two methods above work perfectly for String types also, so we're not getting all the details we need to know to answer your question.
RageInTheMachine9532
|
|
|
|
|
So you're looking to dynamically increase the size of the array? If so, the earlier suggestion of Redim should work for you. You may want to look at the ArrayList class in the .Net Documentation anyway - the Add method makes it easy to work with a dynamically increasing list, and there are CopyTo and ToArray methods if you need to convert it to an actual Array object.
|
|
|
|
|
redim preserve numarray(size)
numarray(ubound(numarray)) = newobject
size += 1
|
|
|
|
|
Dear Ladies|Gentlemen:
I developed a visual basic program in VB4
on Win3.11 (16 bit)incorporating an API
call to produce a 'siren' effect.
The executible worked fine in the 16 bit
environment but upon running it under
Win98 and Win98se the 'siren' effect
doesn't work! There are no 'run time'
errors... just no 'siren'!
The API is defined in 'general declarations':
Option Explicit
'api for sound.drv (called by subroutine 'racket')
'resides in module.bas
Declare Function opensound% Lib "sound.drv" ()
Declare Function setvoicesound% Lib "sound.drv" (ByVal nsource%, ByVal freq&, ByVal nduration%)
Declare Function startsound% Lib "sound.drv" ()
Declare Function closesound% Lib "sound.drv" ()
Declare Function waitsoundstate% Lib "sound.drv" (ByVal state%)
'The 'siren', named 'racket' is conditionally called from a subroutine:
Public Sub racket()
Dim t, n2, n3
Dim frequency As Long
Dim duration As Integer
t = opensound() 'start freq
again: 'label to repeat for siren effect
'n3 = frequency; here set in a for-next loop
'n2 = duration in 1/10th sec; + _
set here; now = to .3 sec
n2 = 8 'duration;
duration = n2
For n3 = 500 To 1200 Step 50 'freq in a for next loop
frequency = n3 * 65536
t = setvoicesound(1, frequency, duration)
t = startsound()
While (waitsoundstate(0) <> 0): Wend
't = closesound() stops frequency
DoEvents
Next n3
GoTo again
End Sub
How do I make this API work in windows 98 and 98se?
Thank you, Ralph
Thank you, Pedagogy
|
|
|
|
|
You could replace all the above declarations with one to the Beep API.
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/beep.asp">http:
Don't know if it is going to produce the exact same results, but the parameters you are using are the same as Beep.
RageInTheMachine9532
|
|
|
|
|
how can I write uninstaller by vb.net that will unistall my installed program.
tbhattacharjee
|
|
|
|
|
You can uninstall an .MSI (Windows Installer) installed application just by launching the .MSI file with the /x switch:
msiexec /x full_path_to_filename.MSI
RageInTheMachine9532
|
|
|
|
|
I want that when some on will run setup then setup will ask for serial no before installing software
tbhattacharjee
|
|
|
|
|
how can I create a setup.exe in .net that when application will be installed then a presentation of my software will be shown.please guide me in detail.
tbhattacharjee
|
|
|
|
|
I browse the site www.only4gurus.com then I found that they change the look & feel of the scrollbar of internet explorer, so I want to know how can I develop a that kind of site where design of the scrollbar will be defined by me.
tbhattacharjee
|
|
|
|
|
You can use the CSS Styles:
<html>
<head>
<style type="text/css">
<!--
body {scrollbar-3dlight-color:gold;
scrollbar-arrow-color:yellow;
scrollbar-base-color:tomato;
scrollbar-darkshadow-color:orange;
scrollbar-face-color:teal;
scrollbar-highlight-color:hotpink;
scrollbar-shadow-color:magenta}
-->
</style>
</head>
I think... It's been a while since I've done something like that..
Despite the high cost of living, it remains popular.
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
|
|
|
|
|
You will need to use styles via stylesheets or use inline styles within your webpage.
Check out the following link, this should help...
http://msdn.microsoft.com/workshop/samples/author/dhtml/refs/scrollbarColor.htm
Cheers
Colin
|
|
|
|
|
I did not have internet transfer control. So I downloaded it and resgistered it using regsvr32. But its giving me Licence error.
Any solution ??
|
|
|
|
|
when i'm using inheritance... how can i call the base class constructor from the derived class...
in C# i can call it by using
:base(...,...)
what's the equivalent syntax in VB.NET...
thax in advance
|
|
|
|
|
Use the MyBase keyword - the base constructor will be the New sub:
Class MyClass
Inherits SomeOtherClass
Sub New()
MyBase.New()
...
End Sub
End Class
|
|
|
|
|
|
I need help in displaying personnel photos stored in a SQL 2000 table either in a field with datatype image or a field with datatype nvarchar which has the path to the photo. Which is better to use?
I have a vb6 project with a Picture box, but when I set the DataField property to the field name, the photo does not display. I have a DataGrid that lists each personnel name, so I want to be able to select a record and the person's picture displays in the Picture box. The DataGrid's DataSource property is set to an ADODC data control.
I can do this easily with the table being in Access using the OLE control and setting the DataField property to the field name in the Access table. But the user wants to move the tables to SQL 2000 and wants to update the VB6 project to use ADODC data controls instead of the intrinsic data control.
Any help would be greatly appreciated.
And I thought this would be an easy task.
|
|
|
|
|
Need some help. Can someone advise how I can transpose columns and rows - with datagrid from a database. Or is there a different approach. I'm trying to develop a Corporate Finance module which requires financial statements to be presented as columns even though the information is stored as rows in Access.
Some background: I used to be an excellent Pascal programmer, after 10 years of programming I left IT in 1992. I bought Visual Basic .NET about 2 weeks ago - it is a culture shock even though I have picked up VB 6.0 and Access.
Vision is everything
|
|
|
|
|
In vb.net I found installer class so I want to know what is the utility of installer class and how cani use it and also please tell me from where I could know about installer class in detail.
tbhattacharjee
|
|
|
|
|
|
They're there for a reason, you know.
|
|
|
|
|
In Visual basic there is api viewer which provide functions and constant etc which can be called from vb but in vb.net I could not find utility like api viewer so that is why how could I know which api functions can be called from vb.net and from where I could know
Which api functions can be called from vb.net .please tell me.
tbhattacharjee
|
|
|
|
|
Pretty much all the API calls can be called from VB.NET - but because the framework provides about 90% of the functionality of the API it is prefereable to look therein first.
Do a search in the help on <DLLImport()> attribute and look at the System.Interop namespace
'--8<------------------------
Ex Datis:
Duncan Jones
<a href="http://www.merrioncomputing.com">Merrion Computing Ltd</a>
|
|
|
|