Missing semicolon

While in the editor I have a function that has been working forever now it it has a redline under the code Return sStr2 when I mouse over is shows a small dialog with the words missing semicolon. I am coding in Basic. I don’t understand, when i deploy my code to the server I get the error message Unexpected identifier. line 3322 column 12 Please help I am on deadline

Can you show us the actual code?

Function CheckForPhoto(sss)
  Dim i,x,sStr2,sStr3
  sStr2 = "n"
  For i = 0 To iRosterSize
    If aRoster(i,1) = sss And aRoster(i,12) = 1 Then sStr2 = "y"  End If    
  Next i
   Return sStr2    
End Function

Tip : If you’re pasting code, html or config files, surround the code with triple back ticks (```), before the first line and after the last one. It will be formatted properly. (We fixed it for you this time)

Try removing the End If. It doesn’t belong there.

I am sorry but that did not fix the problem…it appears the problem began when I copied this sample code You provide in your documentation when I did it other Functions that Return values are also saying Unexpected identifier. I have since commented out the code but the problems remains
‘’'Function Hamburger1_onclick()
Dim Return

Return = InputBox(“Enter Your Pass Code”, “”, “”)
If Len(Return) = 4 Then
Exit Function
End If
‘If Hamburger1.selection =“Login” Then MsgBox(“Login”)
‘If Hamburger1.selection =“Staff” Then MsgBox(“Staff”)
‘If Hamburger1.selection =“Board” Then MsgBox(“Board”)

End Function’’’

Now every function that has a Return is not working please I run a Semi Pro Football League with my App and all the fans use this App to keep up with what is going on around the league and it wont run with the error that is being generated I have removed all the code added today but the Functions which return data are not working but were 2 days 2 weeks ago

@DaveHolt - would you try that formatting trick I gave a couple of messages back? It makes your code much easier to read!

I think your issue is that you are using a keyword “Return” as a variable name which is always problematic. Try replacing your Return variable name with something else (btw I also use AppStudio for developing apps for semi pro football)

Thanks Michael the Return variable was actually from sample InputBox code check it out in the language reference . BTW which Semi Pro League?

The wiki is kept upto date by the AppStudio user community as well as George and his team. The examples in particular can be user contributions and i think this one was abit dated. Ive edited it to use txtReturn as the variable name rather than Return.

The apps i do are as a volunteer at St Albans City FC of the National League South in England (you can find my club app built using AppStudio on Googke Play or the Appstore by searching “St Albans City FC app”. I also have a ticket check in app that we use on our turnstiles that connects usb scanners for ticket scanning)

Not sure if you realised that the End If was missing after each If statement. (Unless you’ve got them stated further on?)

If Hamburger1.selection =“Login” Then MsgBox(“Login”)
End If
If Hamburger1.selection =“Staff” Then MsgBox(“Staff”)
End If
If Hamburger1.selection =“Board” Then MsgBox(“Board”)
End If
End Function```

@William_Robinson - please edit your message with the following tip. I’m really not sure what you are trying to say in your message:

Tip: If you’re pasting code, html or config files, surround the code with triple back ticks (```), before the first line and after the last one. It will be formatted properly.

I’m getting there, may take me a while :laughing: :+1:

At what point are you doing this? Is it in startup code, or in response to something like a button?

If you do an operation like this too soon after startup, the Input control may not be created yet.

The input is way after the app has loaded and the user has to go through several screens until they are prompted to enter security code to update stats for their team

What happens the user enters the code then presses an OK button and I read the input.value which keeps coming back as undefined

This thread seems to have gotten mixed up.

@DaveHolt - could you post the code which is causing the error?

‘’‘Function btnLoginOk_onclick()
Dim sCode
sCode = inpLogin4.value
End Function’’’

sCode keeps displaying undefined