dcsimg

Search:

Type: Posts; User: David Anton

Page 1 of 13 1 2 3 4

Search: Search took 0.29 seconds.

  1. Replies
    39
    Views
    852

    Re: Learning C# from VB

    Actually, in C# you can just write "a == b" instead.

    Agree with you about math: there are subtle issues converting either way.
  2. Re: Help with converting few lines of C# to VB.NET

    There are 2 main problems with the conversion:

    1. The 'If' operator is a pretty clear conversion of the C# ternary conditional operator - the converter should have handled it:


    Dim...
  3. Replies
    7
    Views
    387

    VS 2019 Re: Select Case not working

    There's nothing incorrect about 'Select Case True', but if it's taught everywhere, then that's just sad. Usually, you would only accept a hacky construct if it provides some major benefit, but...
  4. Replies
    7
    Views
    387

    VS 2019 Re: Select Case not working

    I know it's a little off-topic, but Select Case True is not the most readable way to write this - isn't the following more obvious?


    If .Contains("00 WAITING FOR ANSWER") Then
    counter += 1...
  5. Re: vbCr equivalent, without using VisualBasic namespace

    The exact equivalent of vbCr is "\r". You almost certainly don't want Environment.NewLine since that is not a specific character. I also don't know why some are recommending a combination of...
  6. Re: My visual basic program contains viruses

    Most virus scanners use some degree of heuristics where they are guessing that a virus exists based on some patterns.
    Some (such as Symantec) rely a lot on heuristics and have very high false...
  7. VS 2019 Re: Anybody ever see an error like this? If so, why is it happening?

    I see this often actually (nature of my business). No real mystery - VB will auto-initialize a variable that is not initialized in its declaration (and uses 0 for numeric types). However, if the...
  8. Replies
    9
    Views
    528

    Re: String.Replace not working

    Now we're getting somewhere. The 'Replace' call you want to make (...Replace(".sldasm", ".slddrw")) will only be reached if the call in the 'Try' block causes an exception. Is this what you...
  9. Replies
    9
    Views
    528

    Re: String.Replace not working

    Like I'm always telling my customers: "provide an example which reproduces the problem".


    Dim test As String = "C:\Sackett-Waconia\Testing-Steve\sE7082699.SLDASM"
    Dim MatchDrawingFile As String...
  10. Replies
    8
    Views
    827

    Re: Translation to VB.NET

    As Shaggy Hiker already said, rename from msgBox to something else.
    Also, you can't assign to a variable within a condition like you can in C# (because VB uses the same operator for both assignment...
  11. VS 2017 Re: Strange behavior with strings

    You know you're doing something crazy (branching on an implicit integer to boolean conversion) and you're doing it anyway ... God help anyone maintaining your code.
  12. Re: Exit function vs Return and stack overflow issue?

    This has nothing to do with stack overflow. The first example is the clumsy way of returning a function result that is compatible with VB6. The second, using 'Return' is what everyone in this...
  13. Re: Need help with converting this code from C# to VB.net

    The main problem I see in your initial attempt is that you are sizing arrays like C# does - by length, where you should be sizing by the upper bound (one off from length). (I'm also using the...
  14. Re: A little help with translating C# to vb.NET please.

    As Paul mentioned, it's C code.
    Except for DISPLAY_DEVICE and DEVMODE, the other typedef's translate roughly to the following:


    Private Sub DetachDisplay()
    Dim FoundSecondaryDisp As Boolean =...
  15. Replies
    11
    Views
    785

    Re: Syntax to do if statement in oneline

    Sorry - didn't mean to post the same reply twice - I'd delete it if I could find that option...
  16. Replies
    11
    Views
    785

    Re: Syntax to do if statement in oneline

    Just to expand slightly on what John explained - there are a few ways to condense the 'usual' If/Else down to one line:

    Shorthand 'If' statement (combine on one line, leaving off the 'End If'):
    ...
  17. Replies
    5
    Views
    679

    Re: Is VB what I should be using?

    In a VB forum, you just might get some bias...

    However, don't let anyone ever tell you that VB is inferior to any other language (and some will try) - it has all of the most useful features of...
  18. VS 2015 Re: Strong naming an assembly for VB

    Here's a good comparison of strong naming vs digital signing:
    https://blogs.msdn.microsoft.com/ericlippert/2009/09/03/whats-the-difference-part-five-certificate-signing-vs-strong-naming/

    Strong...
  19. Re: Conversion from C# to VB.Net

    If the C# code uses pointers ('unsafe' code), then leave it in C# - there is no VB equivalent to C# pointers. ('Unsafe' code isn't even recommended in C#).
  20. Replies
    10
    Views
    894

    Re: code conversion

    Functional programming has made 'spaghetti lambda code' more common - the VB equivalent is:


    dt1.AsEnumerable()
    .Join(dt2.AsEnumerable(),
    Function(d) d.Field(Of String)("col1D"),...
  21. Replies
    4
    Views
    387

    Re: Incrementing letter characters

    You will probably have to tweak the loop bounds since my example was just for capital 'A' to capital 'Z'.
  22. Replies
    4
    Views
    387

    Re: Incrementing letter characters

    Sure:


    Dim s As String = ""
    For i As Integer = AscW("A"c) To AscW("Z"c)
    s &= ChrW(i)
    Next i
  23. Re: Converting C# to Vb.net Issues with code when converted.

    The 'CreateTab' method should be the following in VB:


    Public Overrides Function CreateTab() As TitleBarTab
    Return New TitleBarTab(Me) With {
    .Content = New TabWindow With {.Text =...
  24. Re: Converting C# to Vb.net Issues with code when converted.

    The 'using' block is converted incorrectly (especially the "= Me" part) - try the following:


    Using ms As New MemoryStream()
    Dim read As Integer

    read = stream.Read(buffer, 0,...
  25. Re: Please Help me to improve design dekstop application

    I've heard good things about telerik - http://www.telerik.com, but haven't used them myself.
  26. VS 2013 Re: [RESOLVED] Questons about code signing certificate

    One thing I should mention: Even with code signing, you may at first see that the Windows install dialog leans a little to the 'warning' side, until more people install your software. In our case,...
  27. VS 2013 Re: Questons about code signing certificate

    We use 'signtool' - and construct a .bat file with our builder to call signtool, passing it the code signing password, the key file, and the timestamp server (whoever you buy the certificate from...
  28. VS 2013 Re: Questons about code signing certificate

    A single code signing certificate is all you need.
    We used DigiCert - their support/process was very good.
  29. Replies
    8
    Views
    1,582

    Re: find years with 53 weeks

    All years have either 365 days or 366 days - this number divided by 7 is always closer to 52 than 53.
  30. Replies
    8
    Views
    1,582

    Re: find years with 53 weeks

    The question makes no real sense.
    A year has either 52 weeks + 1 day or is a leap year - 52 weeks + 2 days. Neither of these is "53 weeks".
    All years have 52 weeks + a day or two - never is this...
  31. Replies
    4
    Views
    571

    Re: converting two c# lines into vb

    What you have there is an assignment within an expression - some may call it an 'embedded assignment'.
    This is not available within VB (mainly due to the fact that both assignment and equality...
  32. Replies
    9
    Views
    666

    Re: Fastest method of looping?

    There are some optimization considerations for nested loops.
    e.g., if the function 'F' is expensive to call, then the first nested loop will perform much worse than the second since 'F' will be...
  33. Replies
    8
    Views
    1,542

    Re: Confusion converting C# code.

    In case anyone's confused about the generic ArrayList, this is Java code, not C#. (The 'throws' clause on the method header is the clue - C# doesn't have method throws clauses).
    The VB equivalent to...
  34. VS 2012 Re: If operator and Nullable - Error?

    VB does not care what you are assigning the result to - it only looks at the arguments of the 'If' operator call and neither argument says 'nullable' since 'Nothing' can apply to any type. So VB uses...
  35. Replies
    1
    Views
    425

    Re: streamread/write

    Same idea:

    File.WriteAllLines(filePath, File.ReadAllLines(filePath).Where(Function(s) Not s.Startswith("C:\$Recycled")
    AndAlso Not s.Contains("C:\Windows\temp\partfile*here.tmp"))

    edit: I just...
  36. VS 2012 Re: Microsoft Project Centennial - Lost and Confused

    Do you know anyone who's using Office on their phone?

    Ok - I should have avoided the word 'serious' - I know that GPS apps, for instance, are serious, but there's a large subset of applications...
  37. VS 2012 Re: Microsoft Project Centennial - Lost and Confused

    I'm not saying Microsoft should ignore the mobile market - just don't expect everything to become mobile.
    Put something out there on the new runtime for serious applications also.
  38. VS 2012 Re: Microsoft Project Centennial - Lost and Confused

    Our tools need to fully reflect on both traditional .NET assemblies and newer .winmd files - both of these are a problem with UWP right now - and I don't think UWP apps will *ever* be able to reflect...
  39. VS 2012 Re: Microsoft Project Centennial - Lost and Confused

    I guess I don't take something seriously until they can decide what to call it...
    Both the nomenclature and the technology behind 'Metro' has changed continuously since Metro. That tells me it's not...
  40. VS 2012 Re: Microsoft Project Centennial - Lost and Confused

    It's a little work, but one approach is:
    1. Make a web site.
    2. Get a Google Adwords account and find some keywords that people might use to find your product (set budgets so you don't get a...
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Featured


Click Here to Expand Forum to Full Width