Ask coding questions

← Back to all posts
Variables showing blank after being defined
h
RossJames (271)

Hi, I am having trouble getting my script to read variables after i define them. They just seem to be blank. On the first few lines of main.js, i defined authlevel to 0 but on line 123, authlevel is blank. Any ideas?
https://repl.it/@RossJames/Simple-Live-Chat

Thanks!

@geocube101 Any ideas?

Answered by kpostal10 (21) [earned 5 cycles]
View Answer
Commentshotnewtop
kpostal10 (21)

Right now from the code that is there the only 2 places where authlevel is lines 107 and 108.

RossJames (271)

@kpostal10 Hi, Are you checking main.js under client?

kpostal10 (21)

@RossJames No I was not, do not recalll seeing where it was specified my mistake. From what I see you set it authlevel on line 8 then you set auth to (authlevel) 122 but if you are trying to pull that from outside the file you might get conflicting varible names.

Geocube101 (588)

What's going on on line 131?
If your trying to add the dash to auth, then you should do

var cmderr = String(auth) + '-';

which converts auth to a string then adds the dash to it.