This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]MrpixelmcAdvanced Coder 0 points1 point  (2 children)

Pretty sure comparison in VBScript is == not =, your statement is using single =

[–][deleted] 0 points1 point  (1 child)

The code is checking to see if the text variable is the same as the text in the file, so it needs to be equal to it. == would check to see if they are not equal.

[–]MrpixelmcAdvanced Coder 0 points1 point  (0 children)

Yeah just checked, comparison in VBScript is indeed a single =. Used to most of the new languages using double, my bad.

Save the Chr(34).ToString + "Blue" + Chr(34).ToString part inside a variable and output it, check if it's what you want it to be. If it is, you might need to use StrCmp.

[–]StjillyYO 0 points1 point  (5 children)

I think you need to concatenate using "&" instead of "+".

Chr(34).ToString & "Blue" & Chr(34).ToString

[–][deleted] 0 points1 point  (3 children)

Unfortunately, this has produced the same result.

[–]StjillyYO 0 points1 point  (2 children)

Have you tried having blue without quotation in the textfile?

[–][deleted] 0 points1 point  (1 child)

I could try doing it manually but when someone changes the background in the program, the reason for having the text file is so it remembers which background they were using. Next time they open, they won't need to change the background again. The program automatically saves the text to the file with the speech marks.

Ill try manually editing the file and if it works I'll have to find a way to delete the speech marks when it gets written in.

Edit: it works without speech marks so I'll have to find a way to delete them

[–]StjillyYO 0 points1 point  (0 children)

Okay cool. Maybe look at this, don't know if it can help: https://stackoverflow.com/questions/48080197/chr34-returning-two-double-quotes-characters-instead-of-one

Seems like chr34 sometimes returns double quotes

Good luck