charlieelliott785@hotmail
Member
Well I am going to post another question, I don't know how to do that. I looked around and got this:
1. Please post the code AND the error message from the logs as TEXT within CODE TAGS.
I have a how to question, I have no error messages and I have no idea what CODE TAGS are
2. Don't post images
I don't have any images to post
3. Describe what the problem is (full sentences, not 3 words, not "my car doesn't work - guess what it is")
In VB6 in a Function (for that matter a subroutine too) code can be entered like this:
Function SomeFunction(Arg1 as Type1, Arg2 as Type2, ....) as ReturnType
If SomeCondition Then
Return (Answer1)
End if
If SomeOtherCondition Then
Return (Anwer2)
End if
Return (Answer 3)
End Function
note: the function exits on any return statement
I could also write:
Function SomeFunction(Arg1 as Type1, Arg2 as Type2, ....) as ReturnType
If SomeCondition Then
SomeFunction = Answer1
Exit SomeFunction
End if
If SomeOtherCondition Then
SomeFunction = Anwer2
Exit SomeFunction
End if
SomeFunction = Answer 3
End Function
note: the function exits on the Exit or End Statements
So my question is simple:
Can one have multipe return statement in a sub in B4X? as in:
Sub SomeFunction(Arg1 as Type1, Arg2 as Type2, ....) as ReturnType
If SomeCondition Then
Return Answer1
End if
If SomeOtherCondition Then
Return Anwer2
End if
Return Answer 3
Sub End
and will the function terminate when a return is executed?
4. Use the search function FIRST (assume you're not the first person having that question)
i don't know how to use the search function and searching for Return does no result in any practical answers
5. Assume that we have many power users here having huge and complex apps. B4x is working 100%. So if you have an issue it's mostly a programming mistake
i don't know how to code multiple return statements, I don't know what to do (and it is rather arrogant to assume mostly all errors are programming mistakes)
6. Don't start complex projects without any experience
i do not have a complex project (I don't even know what you people consider a complex project)
7. We love to help but you need to help us to understand the issue (see esp. 1 - 3)
i don't think i can be any clearer!!!!
8. Read the tutorials and manuals
i have read the tutorials and manuals they do not answer this simple question
9. Install B4x as described!
i have installed B4X as described. I even installed it on a "clean" computer. Just had Windows 10 on it.
10. Have fun
really?
Erel: 11. Always start a new thread for your question.
I have no idea what this means
I am an expert in VB6 I wrote my first program for money in 1966 (that's correct I am over 70 years old) I ran a very successful software company for over 30 years. At one time my company supported over 300 school districts in the world, and printed over 360,000 report cards a year. The final "think" I did before I sold the company I converted all the VB6 code mechanically to HTML, JavaScript, PHP, and CSS (I wrote that conversion) program. My college degrees are from the University of Wisconsin,.
So I am confused, these 11 steps do not tell me how to ask a question. And I know a lot about systems and programming. My first "school" client purchased my system in 1980.
The steps specify rather obvious steps on how to ask a question, but not one step in where or how i enter a question in the forum.
Happy Computing
Charlie
1. Please post the code AND the error message from the logs as TEXT within CODE TAGS.
I have a how to question, I have no error messages and I have no idea what CODE TAGS are
2. Don't post images
I don't have any images to post
3. Describe what the problem is (full sentences, not 3 words, not "my car doesn't work - guess what it is")
In VB6 in a Function (for that matter a subroutine too) code can be entered like this:
Function SomeFunction(Arg1 as Type1, Arg2 as Type2, ....) as ReturnType
If SomeCondition Then
Return (Answer1)
End if
If SomeOtherCondition Then
Return (Anwer2)
End if
Return (Answer 3)
End Function
note: the function exits on any return statement
I could also write:
Function SomeFunction(Arg1 as Type1, Arg2 as Type2, ....) as ReturnType
If SomeCondition Then
SomeFunction = Answer1
Exit SomeFunction
End if
If SomeOtherCondition Then
SomeFunction = Anwer2
Exit SomeFunction
End if
SomeFunction = Answer 3
End Function
note: the function exits on the Exit or End Statements
So my question is simple:
Can one have multipe return statement in a sub in B4X? as in:
Sub SomeFunction(Arg1 as Type1, Arg2 as Type2, ....) as ReturnType
If SomeCondition Then
Return Answer1
End if
If SomeOtherCondition Then
Return Anwer2
End if
Return Answer 3
Sub End
and will the function terminate when a return is executed?
4. Use the search function FIRST (assume you're not the first person having that question)
i don't know how to use the search function and searching for Return does no result in any practical answers
5. Assume that we have many power users here having huge and complex apps. B4x is working 100%. So if you have an issue it's mostly a programming mistake
i don't know how to code multiple return statements, I don't know what to do (and it is rather arrogant to assume mostly all errors are programming mistakes)
6. Don't start complex projects without any experience
i do not have a complex project (I don't even know what you people consider a complex project)
7. We love to help but you need to help us to understand the issue (see esp. 1 - 3)
i don't think i can be any clearer!!!!
8. Read the tutorials and manuals
i have read the tutorials and manuals they do not answer this simple question
9. Install B4x as described!
i have installed B4X as described. I even installed it on a "clean" computer. Just had Windows 10 on it.
10. Have fun
really?
Erel: 11. Always start a new thread for your question.
I have no idea what this means
I am an expert in VB6 I wrote my first program for money in 1966 (that's correct I am over 70 years old) I ran a very successful software company for over 30 years. At one time my company supported over 300 school districts in the world, and printed over 360,000 report cards a year. The final "think" I did before I sold the company I converted all the VB6 code mechanically to HTML, JavaScript, PHP, and CSS (I wrote that conversion) program. My college degrees are from the University of Wisconsin,.
So I am confused, these 11 steps do not tell me how to ask a question. And I know a lot about systems and programming. My first "school" client purchased my system in 1980.
The steps specify rather obvious steps on how to ask a question, but not one step in where or how i enter a question in the forum.
Happy Computing
Charlie