R RB Smissaert Well-Known Member Licensed User Longtime User Feb 13, 2021 #1 B4X: Copy Wait For (File.CopyAsync(File.DirRootExternal & "/PhonePats/", strMainDBName, Starter.strSD_DB_Dir, strMainDBName)) _ Complete (bSuccess As Boolean) Where strDBName is a string variable in Main Sub Process_Globals() For some reason strMainDBName is not highlighted (purple) in the above code. Otherwise it shows fine highlighted eg: B4X: Copy lblFileCopy.Text = "Copying DB, " & strMainDBName & " (" & strFileSize & ") ..." RBS
B4X: Copy Wait For (File.CopyAsync(File.DirRootExternal & "/PhonePats/", strMainDBName, Starter.strSD_DB_Dir, strMainDBName)) _ Complete (bSuccess As Boolean) Where strDBName is a string variable in Main Sub Process_Globals() For some reason strMainDBName is not highlighted (purple) in the above code. Otherwise it shows fine highlighted eg: B4X: Copy lblFileCopy.Text = "Copying DB, " & strMainDBName & " (" & strFileSize & ") ..." RBS
agraham Expert Licensed User Longtime User Feb 13, 2021 #2 The highlighter does not parse code. Only literal strings are highlighted, variable names are not. Upvote 0
R RB Smissaert Well-Known Member Licensed User Longtime User Feb 13, 2021 #3 agraham said: The highlighter does not parse code. Only literal strings are highlighted, variable names are not. Click to expand... Ok, but then why does for it for example highlight if you do: B4X: Copy Round(strDBName) RBS Upvote 0
agraham said: The highlighter does not parse code. Only literal strings are highlighted, variable names are not. Click to expand... Ok, but then why does for it for example highlight if you do: B4X: Copy Round(strDBName) RBS
Sandman Expert Licensed User Longtime User Feb 13, 2021 #4 This might one of the few cases where it's actually appropriate to post code as a screenshot. Upvote 0
agraham Expert Licensed User Longtime User Feb 13, 2021 #5 RB Smissaert said: Ok, but then why does for it for example highlight if you do: Click to expand... As far as I can see it doesn't unless you omit the declaration in which case it is highlighting it as an error, not because it is a string Upvote 0
RB Smissaert said: Ok, but then why does for it for example highlight if you do: Click to expand... As far as I can see it doesn't unless you omit the declaration in which case it is highlighting it as an error, not because it is a string
R RB Smissaert Well-Known Member Licensed User Longtime User Feb 13, 2021 #6 Sandman said: This might one of the few cases where it's actually appropriate to post code as a screenshot. Click to expand... Attached a screenshot. RBS Attachments IDEHighlight.zip IDEHighlight.zip 155.6 KB · Views: 489 Upvote 0
Sandman said: This might one of the few cases where it's actually appropriate to post code as a screenshot. Click to expand... Attached a screenshot. RBS
agraham Expert Licensed User Longtime User Feb 13, 2021 #7 If it's a screenshot why is it in a docx file? 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. Upvote 0
If it's a screenshot why is it in a docx file? 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.
agraham Expert Licensed User Longtime User Feb 13, 2021 #8 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! Upvote 0
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!
R RB Smissaert Well-Known Member Licensed User Longtime User Feb 13, 2021 #9 agraham said: 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! Click to expand... Indeed. Will find a better way to post images for next time. RBS Upvote 0
agraham said: 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! Click to expand... Indeed. Will find a better way to post images for next time. RBS
agraham Expert Licensed User Longtime User Feb 13, 2021 #10 RB Smissaert said: Will find a better way to post images for next time. Click to expand... I just drag them on to the compose panel and resize them there. Upvote 0
RB Smissaert said: Will find a better way to post images for next time. Click to expand... I just drag them on to the compose panel and resize them there.
Cableguy Expert Licensed User Longtime User Feb 13, 2021 #11 RB Smissaert said: Indeed. Will find a better way to post images for next time. RBS Click to expand... I just use the "printscreen" key and past it in place and resize as needed Upvote 0
RB Smissaert said: Indeed. Will find a better way to post images for next time. RBS Click to expand... I just use the "printscreen" key and past it in place and resize as needed
M Mahares Expert Licensed User Longtime User Feb 13, 2021 #12 agraham said: so it does look like a bug! Click to expand... Something like this will work. See working code and screenshot that shows the purple Code: Copy Public str1name As String ="andrewOne.txt" 'Process_Globals Public str2name As String ="andrewTwo.txt" Code: Copy 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 Attachments andrew.PNG 6.4 KB · Views: 606 Upvote 0
agraham said: so it does look like a bug! Click to expand... Something like this will work. See working code and screenshot that shows the purple Code: Copy Public str1name As String ="andrewOne.txt" 'Process_Globals Public str2name As String ="andrewTwo.txt" Code: Copy 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
R RB Smissaert Well-Known Member Licensed User Longtime User Feb 13, 2021 #13 Mahares said: Something like this will work. See working code and screenshot that shows the purple Code: Copy Public str1name As String ="andrewOne.txt" 'Process_Globals Public str2name As String ="andrewTwo.txt" Code: Copy 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 Click to expand... Yes, that highlights the variable, but no need to declare the variable Public and no need to assign an initial string. RBS Upvote 0
Mahares said: Something like this will work. See working code and screenshot that shows the purple Code: Copy Public str1name As String ="andrewOne.txt" 'Process_Globals Public str2name As String ="andrewTwo.txt" Code: Copy 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 Click to expand... Yes, that highlights the variable, but no need to declare the variable Public and no need to assign an initial string. RBS
M Mahares Expert Licensed User Longtime User Feb 13, 2021 #14 RB Smissaert said: Yes, that highlights the variable, but no need to declare the variable Public and no need to assign an initial string. Click to expand... 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. Last edited: Feb 13, 2021 Upvote 0
RB Smissaert said: Yes, that highlights the variable, but no need to declare the variable Public and no need to assign an initial string. Click to expand... 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.
R RB Smissaert Well-Known Member Licensed User Longtime User Feb 13, 2021 #15 Mahares said: 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. Click to expand... 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. RBS Upvote 0
Mahares said: 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. Click to expand... 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. RBS
M Mahares Expert Licensed User Longtime User Feb 13, 2021 #16 RB Smissaert said: The only thing that made the difference is how the Wait For is coded. Click to expand... The code I posted is more general and I was not specifically addressing your issue. It is out there in case someone needs to test. Upvote 0
RB Smissaert said: The only thing that made the difference is how the Wait For is coded. Click to expand... The code I posted is more general and I was not specifically addressing your issue. It is out there in case someone needs to test.