Subj : 2 questions
To : Nightfox
From : DesotoFireflite
Date : Fri Apr 08 2022 09:16 pm
Re: 2 questions
By: Nightfox to DesotoFireflite on Fri Apr 08 2022 04:59 pm
Ni> Re: 2 questions
Ni> By: DesotoFireflite to All on Fri Apr 08 2022 05:45 pm
De>> 1. - When I use console.gotoxy(0,24); it takes me to line 22, not
De>> 24. Is this a normal thing +/- a few lines, or is it supposed to be
De>> dead accurate.
Ni> console.gotoxy() should be exactly accurate. Note that the X and Y cursor
Ni> coordinates are 1-based. You may be off by 1.
Ahhh, I do remember reading that somewhere, now it makes sense
De>> 2. - what are the { and } used for. As far as I can tell be reading
De>> up, they are only deed for condition statements. Just trying to
De>> understand.
Ni> There are several things { and } can be used for.
Ni> 1. To surround blocks of code that contain more than one statement, such
Ni> as: if (x === 1)
Ni> {
Ni> console.print("x is 1");
Ni> console.crlf();
Ni> console.pause();
Ni> }
Ni> 2. When defining functions:
Ni> function printNumber(num)
Ni> {
Ni> console.print(num);
Ni> }
Ni> 3. When defining objects:
Ni> var anObj = {
Ni> aNum: 1,
Ni> aString: "String"
Ni> };
Ni> There may be more cases I'm not thinking of.
OK, great, I can work with that, it's making sense to me now. Thanks for the help my friend. I really don't know why I waited so long to get into js.
SysOp: C.G. Learn, AKA: DesotoFireflite
Valhalla Home Services! - (Synchronet) - bbs.valhallabbs.com:23
A Gamers Paradise - Over 250 Registered Online Game Doors!
--- CAT (n.), Furry keyboard cover.
� Synchronet � Valhalla Home Services � USA �
http://valhalla.synchro.net