EDIT: OK I opened it with WordPad as I'm nervous as hell about docx and doc files. That's not a String highlight it's a Global variable highlight. It will do it regardless of type.
I misunderstood, I thought you were expecting the variable name to be highlighted like a String because it was a String variable. Yes I agree, it does not highlight within the WaitFor so it does look like a bug!
I misunderstood, I thought you were expecting the variable name to be highlighted like a String because it was a String variable. Yes I agree, it does not highlight within the WaitFor so it does look like a bug!
Something like this will work. See working code and screenshot that shows the purple
B4X:
Public str1name As String ="andrewOne.txt" 'Process_Globals
Public str2name As String ="andrewTwo.txt"
B4X:
Dim sf As Object = File.CopyAsync(File.DirInternal, str1name, File.DirInternal, str2name)
Wait For (sf) Complete (Success As Boolean)
If Success Then
Log("file was successfully copied")
Else
Log("Sorry, file copy failed")
End If
Something like this will work. See working code and screenshot that shows the purple
B4X:
Public str1name As String ="andrewOne.txt" 'Process_Globals
Public str2name As String ="andrewTwo.txt"
B4X:
Dim sf As Object = File.CopyAsync(File.DirInternal, str1name, File.DirInternal, str2name)
Wait For (sf) Complete (Success As Boolean)
If Success Then
Log("file was successfully copied")
Else
Log("Sorry, file copy failed")
End If
The important thing is: Does it do the job in copying the file and give you the purple color you were looking for. That is more important than the variables declaration because I do not know the rest of your code. The declaration was just there just to have variables.
The important thing is: Does it do the job in copying the file and give you the purple color you were looking for. That is more important than the variables declaration because I do not know the rest of your code. The declaration was just there just to have variables.
You confused me initially by thinking the variable needed to be Public and have an initial value assigned.
The only thing that made the difference is how the Wait For is coded.