Click here to Skip to main content
15,896,557 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: String concat slow despite Stringbuilder Pin
Paul Conrad28-Jul-08 6:12
professionalPaul Conrad28-Jul-08 6:12 
GeneralRe: String concat slow despite Stringbuilder Pin
Luc Pattyn28-Jul-08 6:21
sitebuilderLuc Pattyn28-Jul-08 6:21 
GeneralRe: String concat slow despite Stringbuilder Pin
frylord28-Jul-08 6:52
frylord28-Jul-08 6:52 
GeneralRe: String concat slow despite Stringbuilder Pin
Luc Pattyn28-Jul-08 7:07
sitebuilderLuc Pattyn28-Jul-08 7:07 
AnswerRe: String concat slow despite Stringbuilder Pin
Luc Pattyn28-Jul-08 6:11
sitebuilderLuc Pattyn28-Jul-08 6:11 
GeneralRe: String concat slow despite Stringbuilder Pin
frylord28-Jul-08 6:27
frylord28-Jul-08 6:27 
GeneralRe: String concat slow despite Stringbuilder Pin
Luc Pattyn28-Jul-08 6:43
sitebuilderLuc Pattyn28-Jul-08 6:43 
GeneralRe: String concat slow despite Stringbuilder Pin
frylord28-Jul-08 7:02
frylord28-Jul-08 7:02 
The manual isn't really clear on this but by trying I figured out that the device needs 4 decimals after the comma to get an accurate output.

For example when I set the Vmax to 9 volts and I want it to output 3 volts (1/3) then I need to set the data point to 0.3333333333333333333 if I had infinite accuracy. But just by trying I found out that by setting the data point to 0.33 i gives me 2.7 volts and when I set it to 0.3333 it gives me 3.01 volts.

I think you might be onto something with the GUI thing.

To be honest my first version wasn't with stringbuilder I think. When I first wrote the code I put it under a button using normal string. Then when I found that was too slow I built the thread thing then later on I put stringbuilder in there.

Okay after some trying I found that the culprit in this case was the progressbar which was being updated every loop. When I just use the stringbuilder it's quite fast.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
        Dim Rnd As Random = New Random()<br />
        Dim Dbl_RndData(65535) As Double<br />
        Dim Str_RndData As StringBuilder<br />
        Dim i As Integer = 0<br />
<br />
        Str_RndData = New StringBuilder()<br />
<br />
        ' Fill the Double array with random data<br />
        For i = 0 To 65535<br />
            Dbl_RndData(i) = Rnd.NextDouble<br />
        Next<br />
<br />
        ' Convert the data to a string using stringbuilder<br />
        For i = 0 To 65535<br />
            Str_RndData.Append(Dbl_RndData(i).ToString("0.0000"))<br />
            Str_RndData.Append(", ")    ' Append a comma to get CSV format<br />
        Next<br />
    End Sub


Thanks for the help.
GeneralRe: String concat slow despite Stringbuilder Pin
Luc Pattyn28-Jul-08 7:10
sitebuilderLuc Pattyn28-Jul-08 7:10 
GeneralRe: String concat slow despite Stringbuilder Pin
frylord28-Jul-08 7:25
frylord28-Jul-08 7:25 
QuestionList Box item coloring Pin
Saam_cse28-Jul-08 1:02
Saam_cse28-Jul-08 1:02 
AnswerRe: List Box item coloring Pin
Luc Pattyn28-Jul-08 1:14
sitebuilderLuc Pattyn28-Jul-08 1:14 
GeneralMenustrip & Selection Pin
Member 425919228-Jul-08 0:19
Member 425919228-Jul-08 0:19 
GeneralRe: Menustrip & Selection Pin
Thomas Stockwell29-Jul-08 9:06
professionalThomas Stockwell29-Jul-08 9:06 
QuestionCreate an excel 2003 add in with vb2008 Pin
JR21227-Jul-08 22:32
JR21227-Jul-08 22:32 
AnswerRe: Create an excel 2003 add in with vb2008 Pin
John_Adams28-Jul-08 8:56
John_Adams28-Jul-08 8:56 
AnswerRe: Create an excel 2003 add in with vb2008 Pin
rprateek6-Aug-08 19:11
rprateek6-Aug-08 19:11 
QuestionSelect the sender in outlook mail Pin
~Khatri Mitesh~27-Jul-08 21:29
~Khatri Mitesh~27-Jul-08 21:29 
QuestionPositioning the image in Excel 2007 [modified] Pin
klaydze27-Jul-08 21:06
klaydze27-Jul-08 21:06 
QuestionThere are not enough concurrent access licenses to log you on. [Crystal report] Pin
AJAYWVK8727-Jul-08 20:44
AJAYWVK8727-Jul-08 20:44 
AnswerRe: There are not enough concurrent access licenses to log you on. [Crystal report] Pin
Christian Graus27-Jul-08 21:17
protectorChristian Graus27-Jul-08 21:17 
GeneralRe: There are not enough concurrent access licenses to log you on. [Crystal report] Pin
Duncan Edwards Jones27-Jul-08 23:59
professionalDuncan Edwards Jones27-Jul-08 23:59 
GeneralRe: There are not enough concurrent access licenses to log you on. [Crystal report] Pin
AJAYWVK8728-Jul-08 22:55
AJAYWVK8728-Jul-08 22:55 
AnswerRe: There are not enough concurrent access licenses to log you on. [Crystal report] Pin
DJ Matthews28-Jul-08 9:11
DJ Matthews28-Jul-08 9:11 
GeneralRe: There are not enough concurrent access licenses to log you on. [Crystal report] Pin
AJAYWVK8729-Jul-08 0:24
AJAYWVK8729-Jul-08 0:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.