Olaan Expert Licensed User Longtime User Oct 28, 2013 #1 Hi all, Assume I created the library which has Translate as the method. When I use it as below Dim NewStr as String= TK.Translate("Text") it return only string for NewStr,but I would like the response return value of succuss(True/False) too. How to coding? I need to recursive loop if it's False by instead of a new input.
Hi all, Assume I created the library which has Translate as the method. When I use it as below Dim NewStr as String= TK.Translate("Text") it return only string for NewStr,but I would like the response return value of succuss(True/False) too. How to coding? I need to recursive loop if it's False by instead of a new input.
Erel B4X founder Staff member Licensed User Longtime User Oct 28, 2013 #2 The simplest way is to return an empty string if it failed. Another option is to create a small class (Type) that holds the string and a boolean result. Upvote 0
The simplest way is to return an empty string if it failed. Another option is to create a small class (Type) that holds the string and a boolean result.
Olaan Expert Licensed User Longtime User Oct 28, 2013 #3 Hi Klaus, The last option is my result,but I 've never seen how to coding,altrough the first option,I think that I could do. Do you have some a example? Thank you in advance. Upvote 0
Hi Klaus, The last option is my result,but I 've never seen how to coding,altrough the first option,I think that I could do. Do you have some a example? Thank you in advance.
Erel B4X founder Staff member Licensed User Longtime User Oct 28, 2013 #4 Code: Copy Type TranslationResult (Text As String, Success As Boolean) ... Sub Translate(s As String) As TranslationResult End Sub Upvote 0
Code: Copy Type TranslationResult (Text As String, Success As Boolean) ... Sub Translate(s As String) As TranslationResult End Sub
Olaan Expert Licensed User Longtime User Oct 29, 2013 #5 Thank you ,Erel (I 've never used Type command before in my life.) Bring Type command in creating the library,Should I use public or not? Code: Copy Public Type TranslationResult (Text As String, Success As Boolean) Last edited: Oct 29, 2013 Upvote 0
Thank you ,Erel (I 've never used Type command before in my life.) Bring Type command in creating the library,Should I use public or not? Code: Copy Public Type TranslationResult (Text As String, Success As Boolean)
Olaan Expert Licensed User Longtime User Oct 29, 2013 #6 OK,I see it. http://www.b4x.com/android/forum/threads/compile-to-library-private-type.25329/#post-164454 Upvote 0
OK,I see it. http://www.b4x.com/android/forum/threads/compile-to-library-private-type.25329/#post-164454