Beginners question

Falcon703549

Member
Joined
Jun 25, 2019
Messages
7
Programming Experience
Beginner
I'm struggling to put together a formula that will look at two fields and provide the correct link based on fields selected previously;


if ( [TBL_CONTACT.LL SERVER] == "License 2" ) {
return "https://web address.php";
}
else
{


The above works, I would like to develop this further......... If this field = "THIS" and THIS FIELD = THAT return THIS .....

if ( [TBL_CONTACT.LL SERVER] == "License 2" ) && [TBL_CONTACT.LL PRODUCT == "Version 4"] {
return "https://web address.VERSION4php";
}
else
{

I seem to be struggling with the addition of &&
 
For future reference, we know that you're posting a question and the fact that you're a beginner isn't really relevant. The title of your thread should describe the subject of the question, not the person asking it. Something like "Issue with multiple criteria in 'if' statement" would be an appropriate title for this thread.
 
By the way, when I say Beginner question, that is exactly what I am, I'm trying to piece together this for personal use, I'm not a developer or programmer so, saying "Take a look at where your parentheses are " - get's me nowhere as I have about 10 minutes experience in C#

Thank anyway.
 
Then you should do some reading and learn a few things about the language first. Asking questions like this is not the way to learn the basics because you'll just flail around. We could answer this one but you'll then just make the same sort of elementary errors again and again. There are plenty of beginner tutorials around that will help teach you the basics, including how to write if statements and the like. There's a link to one of the better tutorials that I'm aware of in my signature below. You really ought to work your way through as a start. A solid grounding in the fundamentals will make things much easier for you and enable you to ask fewer questions and better ones when you do need to.

As for my comment getting you nowhere, it really should. Regardless of how much programming experience you have, I would assume that you have done maths at school and thus have plenty of experience with parentheses, what they're used for and how they work. They group expressions in maths and then group expressions in programming. Look at your code and see what you're grouping and what you're not and if that matches what you're trying to achieve. That, coupled with a reasonable knowledge of the basics of the language garnered from a tutorial or two, should be quite enough to work out what's wrong with that code.
 
Welcome to the forums. A correct title helps other readers know what your topic is about who are searching up similar issues to yourself. It also helps us to know what your problem is in relation to.

Because looking up what parentheses is so hard :: parentheses - Google Search

I assume this is ASP.Net? Otherwise what is this :: return "[URL='https://web/']https://web[/URL] address.php"; ? If it is Asp.net and you're looking to navigate to a new URL in a code behind file, you can use Response.Redirect("youpage.aspx"); and Server.Transfer("yourpage.aspx"). Both have different benefits, but do the same thing.
 
What type of project are you working on? As a starting point, there are very well written docs which explain how to write if statements and use Operators such as | || & && etc can be found on the following link Boolean logical operators - C# reference You will also find additional articles on the left panel. See related links on page Statement keywords - C# Reference
 
This is a simple script (for some) in Sage Act that has to be written in C# - Since Act was updated it no longer accepts VB which I could just about understand and work with. I'm not looking to navigate rather take two fields and depending on theses provide a link within sage act database as a new field that on clicking would open a specific web page that is dedicated to that user.

Hope that makes sense?
 
According to the ACT! FAQ page:
What is an ACT! Plugin?
  • Any .NET assembly that implements ACT’s plugin interface(s) is technically an ACT! plugin

You are not restricted to writing .NET assemblies in C#. You can use F#, IronPython, or VB.NET. Since you already know VB6 presumably, then the jump up to VB.NET shouldn't be too hard.
 
Thank you for trying to help but unfortunately, this does not help.

I am using a Plugin that has been developed to work in Sage Act, within that plugin scripts can be created previously in either VB or C#.

Following the latest update from Sage Act, only C# is supported, therefore I need to change my simple little script from VB to C#.

I'm not trying to learn C#, I have no interest, I had hoped some nice person would be kind enough to provide a simple correction or in plain English point me in the right direction, I'm not a developer, even with VB it would take hours for me to piece together a script from researching the internet to perform a simple repetitive function.

I think I will leave it, my mistake coming here, I guess I'm too old 60+ and find c# very confusing.
 
We are trying to drive you to learn for yourself instead of spoonfeeding you the answer. See the relativistic rock quote in my signature.

To get you started on that path of learning, a C# if statement looks like this:
if ( boolean_condition )
statements_to_execute_if_boolean_condition_is_true

This is different from VB and VB.NET which looks like:
if boolean_condition then
statements_to_execute_if_boolean_condition_is_true
end if

Notice that in C#, the parenthesis surround the condition. Now go back and look at your original code.
 
If statements are not wrote with square brackets [ ], they are wrote with curvy brackets, parentheses ( ) and for each opening bracket, there must be a matching closing bracket. It's relatively easy to spoon-feed you answers, but this is a place of learning, help, and guidance, and if we drip-feed you answers, what do you actually learn from that? If we do that, you will never know why something you tried wasn't working as intended. You learn nothing, and another reason we answer topics in this way is to benefit future readers who make the same mistakes as you; and when they eventually stumble upon this topic or other topics with bad syntax (also like yours), they too won't understand why that code was an issue unless we point you to the correct sources so you can rectify your own mistakes. And only then; once we see commitment and effort from you, will someone provide you with a code handout. That's the way most forums just like this one work. If you don't want to learn the language, you can always hire a developer to do it for you.

Also, what or where does it say that VB is not supported? Just because something is not supported, does not mean you can't use the language which their plugin targets as seen here It's Alive! ! ! Connecting VB.Net to ACT! nor does it say any such thing in the developers pdf. LINK
 
Wow you posted a link to an article that was published 9 years ago.
It's Alive! ! ! Connecting VB.Net to ACT!
[ Edited ]

Options

‎05-27-2010 05:33 PM - edited ‎05-27-2010 05:43 PM

Here is a more upto date link Download PREVIEW version of Act! Addons by Durkin Computing

Impact scripting in Math Functions and Reports
With the release of Act! 21.1 visual basic (VB) scripting is not supported.
 
Back
Top Bottom