B4J Question if sub returns string then

paddy12309

Member
Licensed User
Hi, afraid I'm having a slow day and seem unable to solve this.. I have an if statement that runs after a sub is called, the sub should return a string, how do I get it to run if the string is returned?
B4X:
Subs.ConfigCheck(20)
            If Subs.ConfigCheck = "ConfigsRead" Then
                Dim InconsistentDeviceParam As List
                InconsistentDeviceParam = Subs.GetInconsistentDeviceParams
                Subs.Logwstimed(InconsistentDeviceParam.Size & " Inconsistent Params Found")
                If InconsistentDeviceParam.Size > 0 Then
                    For i = 0 To InconsistentDeviceParam.Size -1
                        Subs.UpdateDeviceParam(InconsistentDeviceParam.Get(i))
                    Next
                End If
                Subs.Store_Response(True) 
            End If
ConfigsRead being the returned statement, any helps greatly appreciated!
Cheers
Paddy
 

stevel05

Expert
Licensed User
Longtime User
Without seeing more code I'm guessing that Subs.ConfigCheck is the sub that returns the value and requires the parameter (20) in which case your code should be:

B4X:
               If Subs.ConfigCheck(20) = "ConfigsRead" Then
                Dim InconsistentDeviceParam As List
                InconsistentDeviceParam = Subs.GetInconsistentDeviceParams
                Subs.Logwstimed(InconsistentDeviceParam.Size & " Inconsistent Params Found")
                If InconsistentDeviceParam.Size > 0 Then
                    For i = 0 To InconsistentDeviceParam.Size -1
                        Subs.UpdateDeviceParam(InconsistentDeviceParam.Get(i))
                    Next
                End If
                Subs.Store_Response(True)
            End If
 
Upvote 0
Top