What Is The Equivalent Function For LTrim?
Aug 22, 2010
im trying to port a small bit of code from c to vb.i dont know if this is c# or objective c or what.anyway, a line of the source i need to port is
for x = 1 to 31
a$ = LTrim(Str$(x))
i know what to do for the first line, but the second line doesnt make sense to me. what is LTrim supposed to do to x? also, what is the equivalent function for LTrim?
View 3 Replies
ADVERTISEMENT
Mar 4, 2009
VB has a function InputBox() that will prompt the user to enter a single value, then click OK. Is there a parallel functionality in ASP.NET, that will get the browser to pop up some kind of input box to return a single value? If not, how do you recommend I achieve this effect?
View 3 Replies
Jul 23, 2009
I have VBA as a namespace in the vb6 code and i would like to know if there is a way of making .net know what there is, is there a specific application namespace? I have been guessing but haven't had any luck (the beauty of the help boxes, if only i knew more of the language)
If you're not living on the edge, you're taking up too much room
View 1 Replies
Jun 22, 2010
Tell vb.net equivalent of following method:
CODE:
Which on build in visual studio 2005 gives an error.
View 2 Replies
Apr 3, 2010
In Access if a query were to compute the sum of different fields where there is a likelihood of one or more fields being NULL, you use something like NZ. Is there any equivalent Function for handling NULLs in VB .NET?
I'm use the code below to retrieve the SUM of the column "BudgetAmt" from my DB but get InvalidCast Exception was unhandled error because the BudgetAmt and/or AllocationPersonnel holds no data:
Dim strSbCode As String = cboSubSubOrg.SelectedValue.ToString
Dim budgetYr As Integer = CInt(cboBudgetYr.Text)
personBudget = CDec(transDetailsDT.Compute("SUM(BudgetAmt)", "FundSource = '02101' AND DataSource = 3" _
[Code].....
View 6 Replies
Jun 1, 2010
I'd like to know if something like this pseudo code:
myVar = "functionName"
call someObject.(myVar evaluation)
which would then be equivalent to:
call someObject.functionName
is possible in VB. I know this is done in some other languages using a GetProperty method.
View 1 Replies
Nov 17, 2009
What is the C# equivalent function of IsNumeric() in VB.. If possible include an example.
View 4 Replies
May 10, 2011
What is the C# equivalent of this VB code?
Private Declare Auto Function InternetSetOption Lib "wininet.dll" (ByVal hInternet As IntPtr, ByVal dwOption As Integer, ByVal lpBuffer As IntPtr, ByVal lpdwBufferLength As Integer) As Boolean
View 1 Replies
May 24, 2011
Does VB.NET have a function to get the quotient like you can in excel.
Quotient(12, 6)
View 3 Replies
May 27, 2010
tell vb.net equivalent of following method:
C# Syntax
public class RecentPosts : Control
{
[code].....
View 3 Replies
May 9, 2009
As a non .net programmer I'm looking for the .net equivalent of the old vb function left(string, length). It was lazy in that it worked for any length string. As expected, left("foobar", 3) = "foo" while, most helpfully, left("f", 3) = "f".
In .net string.Substring(index, length) throws exceptions for everything out of range. In Java I always had the Apache-Commons lang.StringUtils handy. In Google I don't get very far searching for string functions.
Edit:@Noldorin - My first encounter, although it took me several seconds to do the same in c#:
[Code]...
Note the static class and method as well as the this keyword. Yes, they are as simple to invoke as "foobar".Left(3). See also c# extensions on msdn.
View 6 Replies
Jun 18, 2012
what is the equivalent of Access DMin and DMax function in VB.net?
View 1 Replies
Jan 23, 2010
In cell A1 of Sheet2 I have the following text [code]how to I get VB to recognize that the 4<sup>th</sup> character of the string has character code 63?
View 3 Replies
Aug 31, 2009
I have an Excel VBA function that takes a number of optional parameters, including an optional Range:
Function DazBeta(A As Range, Z As Range, _
B As Integer, _
Optional Freq As Integer = 1, _
Optional c As Double = 0, _
Optional r As Range, _
Optional Pct As Boolean = True, _
Optional Label As Integer = 1)
I am translating to VB.NET, and it's the optional Range that is giving me grief because VB.NET does allow optional Ranges. Or rather, optional parameters must provide a default value. What is the recommended way to change the VB.NET function signature so that the code is callable from an Excel cell as a UDF? (The VB.NET implements a UDF, the assembly is registered as a COM server, and the Excel spreadsheet is told of this server and type library, allowing the VB.NET code to be called from an Excel spreadsheet cell.) I have other compilation problems, so I have not been able to explore this. I am thinking that accepting an optional Object (default value Nothing) might work and then I could cast the Object to a Range. Alternatively, if there were a default value that could be specified with an optional Range, that would work, too.
View 1 Replies
May 23, 2012
This question is similar to How to emulate MySQLs utf8_general_ci collation in PHP string comparisons but I want the function for vb.net rather than PhP.Recently I make a lot of supposedly unique key.Some of the keys are equivalent under UTF8 unicode collation.For example, look at these 2 key:
byers-street-bistro_38.15-79.07
byers-street-bistro_38.15-79.07
If I paste that into front page, and look at the source code you'll see
byers-street-bistro__38.15_-79.07
byers-street-bistro__38.15_-79.07
Note: In stack overflow they still look different.I know it's not the same. I guess even in stack exchange it doesn't show. Say I have 1 million such records and I want to test whether 2 string WILL be declared the same by MySQL UTF8 collation. I want to know that before uploading. How do I do that.So vb.net think that those are different keys. When we created mysql query and upload that to database, the database complain it's the same key. Just one complain and the upload of 1 million databases will be stuck.We don't even know what the hell is ? Where can we look that up anyway?Anyway, I want a function that when given 2 strings will tell me whether they will count as the same or not.If possible we want a function that convert strings into their most "standard" form.For example, seems to encode nothing and the function would recoqnize all those nothing character and eliminate that.Is there such thing?So far this is what I do. I need something more comprehensive.
[code]...
View 2 Replies
Jan 31, 2011
I want to execute the code that is passed as a string to my function, the code will be passed at runtime. This is an example code that may be passed as a string to my function. p is a dataset, which is declared and has some values, this code is executed in a asp.net page
p.Tables(0).Rows(0)("disp_status") = "Approved by CEO";
p.Tables(0).Rows(0)("status") = "Approved";
Session("fnc") = "generate po";
[Code]...
View 1 Replies
Oct 12, 2011
I want to make an numerical integration method with takes in an analytic function and integrate it over a specific interval. For the numerical integration procedure I want to use some procedures in nr.com. The problem is that these are programmed in C++ and they uses functors to pass a function to the integration method. How can I do this in VB 2010?
I want to initialize the function (i.e. set a=1,b=0 for function y(x)=a*x+b) and then pass the function to the integration method. Then when the integration method call the function it only calls the function with one parameter (i.e. x since a,b is already set)
What is the best way to do this in VB2010?I want to make a general integration method where I can pass any single valued function and integration limits.
I have just started using VB, and from what I have found so far it seems like the tools you have is
- to us a delegate for the function
- to use a lambda expression for the function
- send a pointer/adressOf
- to create a function class/structure and submit this to the function
As for now I am most inclined to create a function-class. But I am not really sure how.F.ex. I make different classes for each "uniqe function" I want to integrate, but how can I pass them to the integration function when I need to specify the argument type in the integration-function-call?This seems like a basic problem which applies to many Math operations, so I think it would be very useful to clarify this.
View 2 Replies
Apr 1, 2010
I'm trying to undersatnd the syntax of calling a funciton and it seem confusing when I'm using a web service in ASP.net. Maybe this question should be in an ASP forum, but it is a VB question. This simple web service allows you to type in your name and it response with an alert box with you name.
My question is, How can you call a function with 2 arguments when the function is only defined for one. I understand that the second argument is actually a method that handling the respons, but how can you interchange function arguments for methods and how do you know that there are methods for
Here's my call:
<script type="text/javascript">
function HelloWorld()
{
var yourName = $get('txtYourName').value;
[CODE]...
View 7 Replies
May 25, 2012
I am trying to convert a DLL function call which has the Callback function routine called within the DLL function call.The DLL function call signature is like this:
typedef void *HANDLE;
typedef HANDLE HACQDESC;
DECLARE_HANDLE (HWND);
[code]....
how to convert this DLL call to VB.NET and also how to create the callback function and send it as parameter to this function
call.
View 15 Replies
Aug 1, 2009
i wanted to ask how to make picturebox1 ,to which functions are already assigned, perform the same function as picturebox2 ,to which no functions are assigned.For example:I have already made picturebox1 and have assigned it alot of function like when play button is pressed then picturebox1.visible = true and when we press pause button picturebox1.visible = false. So now i decided to make a theme and have to remove the picturebox1 and want to allow the picturebox2 to havefunction of picturebox1.But when i disable the theme the function of picturebox1 should go back to picturebox1.
View 6 Replies
Oct 14, 2010
I know that AndAlso is equivalent to && and OrElse is equivalent to ||. But what is the cleanest way to achieve the equivalent of Visual Basic's And and Or in C#?For example, consider the following VB.NET code.The ValidateForControl method performs some validation and returns whether the state of the specified control is valid. The entire input form is valid if all controls are valid. However, each control must be individually validated even if one is invalid (which requires the operator not to short-circuit). Visual Basic's And operator is perfect for this situation, but unfortunately there's no equivalent operator in C# as far as I know (&& short-circuits).
[Code]...
View 6 Replies
May 24, 2012
I am Validating a TextBox on it's KeyPress Event in VB.
VB.Net
If InStr("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`~!@#$%^&*()_+|[]{};:<>/?,.'" & """" & Chr(8), Chr(KeyAscii)) = 0 Then KeyAscii = 0
What will be it's equivalent in C# ?
View 3 Replies
May 18, 2012
Let me know how can i use this Err in c#.This is VB Code:
If Len(sPart1) <> PART1_LENGTH Then
Err.Raise(vbObjectError, , "Part 1 must be " & PART1_LENGTH)
[code]......
View 4 Replies
Jul 14, 2011
What I am trying to do is to check if a value matches one of two numbers (and easily be able to add to the numbers to compare to). Rather than doing a longer-winded way such as: [Code] I have found that this only works when SectionID is 2 or PageID is 8. If SectionID is 3 or PageID is 12 then it doesn't work. Why is this and what can I do to try to get around the problem?
View 3 Replies
Sep 1, 2010
what is the equivalent for OLE in .net
View 1 Replies
Jan 20, 2011
I'm normally at home in C#, and I'm looking at a performance issue in some VB.Net code -- I want to be able to compare something to the default value for a type (kind like C#'s default keyword).
[Code]...
View 3 Replies
Mar 20, 2012
I am relatively new to Visual Basic. When it comes to logging, in Java I use log4j for logging.What is the equivalent in Visual Basic and can you please guide me to a good tutorial?
View 1 Replies
Jul 28, 2009
private bool txtRegExStringIsValid(string textToValidate)
{
Regex TheRegExpression;
string TheTextToValidate;
[code]....
View 2 Replies
Jul 17, 2011
I've got a large codebase which I'd like to expose to plugin authors to allow them to use VB.Net Express to code plugins for a server app, which is not available to them. My problem is that even with obfuscation, I'd rather not distribute the complete app and/or dlls, as even with obfuscation peeling apart a .NET assembly and puzzling out code is relatively easy to do. I'm interested in this because the licensor I obtain the code from requires me to protect IP and assets and while distributing .NET apps opens up the app to disassembly, keeping the server app private and allowing users to utilize a skeleton dll to code against is a happy medium.
What I'm looking for is some way or a utility to go through my server app source code and create a codeless version of the app which only contains method and property signatures.The intent is to provide a stub .NET dll for them to add as a reference and code against as if they were directly interacting with the server, without actually providing the server code to them, compiled or not. I can of course do this by hand but there are over 90 classes and hundreds of thousands of lines of code I'd rather not spend a week hand tweaking. Also, this presents a problem whenever new methods or code are added to the project. Finally, two separate projects is an even worse scenario.Because people will post suggestions that have little or nothing to do with the question, here's a short, clear example. I want to turn this class:
Public Class MyServer
Public ReadOnly Property Name() As String
Get
Return "Whatever"
[code].....
View 2 Replies
Jan 10, 2012
What is the vb.net expression of this c# expression ?
Frame.GetController<ShowNavigationItemController>().CustomShowNavigationItem += new EventHandler<CustomShowNavigationItemEventArgs>(WindowController1_CustomShowNavigationItem);
View 4 Replies