# Way to test errors in my code

**URL:** <https://forum.choiceofgames.com/t/way-to-test-errors-in-my-code/89401>\
**Category:** General\
**Created:** [November 7, 2020, 5:23am UTC](https://forum.choiceofgames.com/t/way-to-test-errors-in-my-code/89401 "2020-11-07T05:23:04Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArchivistAlpha096](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/archivistalpha096/32/203655_2.png) [@ArchivistAlpha096](https://forum.choiceofgames.com/u/ArchivistAlpha096)\
**Post date:** [November 7, 2020, 5:23am UTC](https://forum.choiceofgames.com/t/way-to-test-errors-in-my-code/89401/1 "2020-11-07T05:23:04Z")

</div>

So. I seem to need a place where I can test my code for arrors and such. Firefox doesn’t seem to be as accessible as it once was, rather annoyingly. I would rather not have to do it manually, mostly because most of the arrors I am running into have to do with indentation, and or tabs and such. Anyone have any suggestions? Also, from what I have been able to gather, quicktest and randomtest don’t seem to work? Never really needed them, and last time I tried to open them, they did something strange, and had to close them down.

---

<div class="post-metadata">

**Author:** ![tangerine\_skies](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/tangerine_skies/32/110083_2.png) [@tangerine\_skies](https://forum.choiceofgames.com/u/tangerine_skies)\
**Post date:** [November 7, 2020, 5:44am UTC](https://forum.choiceofgames.com/t/way-to-test-errors-in-my-code/89401/2 "2020-11-07T05:44:53Z")

</div>

Hi,

If you use nvda, consider using this addon in order to get a better idea about how your indentation looks. The addon provides a way to move between lines on the same indentation, move to parent or child indentation, etc. You can change the default keybindings for these gestures in nvda\>preferences\>input gestures. [https://addons.nvda-project.org/addons/indentNav.en.html](https://addons.nvda-project.org/addons/indentNav.en.html).

also turn on line indentation reporting in the document formatting settings to hear a spoken or sound approximation of your indentation.

---

<div class="post-metadata">

**Author:** ![Loudbeat](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/loudbeat/32/115975_2.png) [@Loudbeat](https://forum.choiceofgames.com/u/Loudbeat)\
**Post date:** [November 7, 2020, 10:56am UTC](https://forum.choiceofgames.com/t/way-to-test-errors-in-my-code/89401/3 "2020-11-07T10:56:44Z")

</div>

Quicktest and randomtest should work afaik, in my experience they are the best tools to find bugs and track stats.  
Here is a modified version of the tool in which you can track stats without the need to print the whole text, which is really useful to me

> [@Generate Statistics About Your Stats](https://forum.choiceofgames.com/t/generate-statistics-about-your-stats/76175):
>
> To help me balance my stats in my work-in-progress, I modified randomtest to take snapshots of my stats and put them in a .csv file, which Excel and other spreadsheet programs can open. I put the changed code [on Github for anyone who wants to give it a try](https://github.com/sgranade/choicescript). You should be able to use it just like you would ChoiceScript from the main repository. To try this out, in your startup.txt file, put a special comment that sets up what variables to save: \*comment savestatsetup [stat1] [stat2] [stat3] Re…

---

<div class="post-metadata">

**Author:** ![ArchivistAlpha096](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/archivistalpha096/32/203655_2.png) [@ArchivistAlpha096](https://forum.choiceofgames.com/u/ArchivistAlpha096)\
**Post date:** [November 7, 2020, 6:01pm UTC](https://forum.choiceofgames.com/t/way-to-test-errors-in-my-code/89401/4 "2020-11-07T18:01:45Z")

</div>

Can you do the:  
\*\*\* \*comment savestatsetup [stat1] ETC, for all your stats? Also, will an actual space, or do you need to go down another line to do so?  
Also. In the tests file, when ever I open 1 of them, I get this arror message:  
\*\*\*: line: 11, char: expected code 100A800F source: microsoft script runtime arror.  
It does that, or something similor, with all the test files I open. I changed the code in my startup on the off-cance it was that, but still says the same thing. Any idea of 1, what it is, and 2, how to fix it? Or, deal with it? Currently, I can’t use any of the testing applications, which was why I was dealing with firefox in the firstplace.

---

<div class="post-metadata">

**Author:** ![Loudbeat](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/loudbeat/32/115975_2.png) [@Loudbeat](https://forum.choiceofgames.com/u/Loudbeat)\
**Post date:** [November 7, 2020, 7:06pm UTC](https://forum.choiceofgames.com/t/way-to-test-errors-in-my-code/89401/5 "2020-11-07T19:06:24Z")

</div>

This is how I used it, just a space between each stat.  
savestatsetup stat1 stat2 stat3 stat4 stat5 etc etc

~~I think you needed to install something on firefox to make the randomtest and quicktest work. Let me see if I can find something about that.~~

I’m not sure but I hope this can help.

> [@Choice Script Changes To Run Tests With Firefox ver 68 ( See Post 12 & 31)](https://forum.choiceofgames.com/t/choice-script-changes-to-run-tests-with-firefox-ver-68-see-post-12-31/59649/30):
>
> I’ve just built out a new, more convenient way to test ChoiceScript, saving you from having to click the “Upload” button every time you test. First, you’ll need to install [Node.js](https://nodejs.org/) and you’ll need the latest version of ChoiceScript from Github. Next, you’ll need to open your “Command Prompt” (on Windows) or “Terminal” (on macOS), and cd to the directory containing ChoiceScript. There, you can run these commands: node serve: Creates a basic localhost web server on a random port number and la…

---

<div class="post-metadata">

**Author:** ![ArchivistAlpha096](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/archivistalpha096/32/203655_2.png) [@ArchivistAlpha096](https://forum.choiceofgames.com/u/ArchivistAlpha096)\
**Post date:** [November 8, 2020, 12:38am UTC](https://forum.choiceofgames.com/t/way-to-test-errors-in-my-code/89401/6 "2020-11-08T00:38:11Z")

</div>

How do I open the command prompt on windows computer? Though, right now trying to unzip the folder, but not haveing much success with even that. Useing the 7Z program, but not seeing an application to unzip the folder, and can’t seem to do it from in the folder. The file type still says zipp, which won’t work if I want to work with the code in notepad.

---

<div class="post-metadata">

**Author:** ![Loudbeat](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/loudbeat/32/115975_2.png) [@Loudbeat](https://forum.choiceofgames.com/u/Loudbeat)\
**Post date:** [November 8, 2020, 1:02am UTC](https://forum.choiceofgames.com/t/way-to-test-errors-in-my-code/89401/7 "2020-11-08T01:02:55Z")

</div>

[windows key] + [R] and type cmd on the bar that appears, you can also find it on the menu as cmd.

Have you tried to use another program to unzip the files?

---

<div class="post-metadata">

**Author:** ![ArchivistAlpha096](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/archivistalpha096/32/203655_2.png) [@ArchivistAlpha096](https://forum.choiceofgames.com/u/ArchivistAlpha096)\
**Post date:** [November 8, 2020, 2:19am UTC](https://forum.choiceofgames.com/t/way-to-test-errors-in-my-code/89401/8 "2020-11-08T02:19:32Z")

</div>

So. I figured out the zip situation, just took the inner Dfabulig folder out of the zipped shell, and put it somewhere else. Bonus, the “index” application actually works now, which is good.  
When I go to the command bar, and type in the CMD? Is there anything else I should do, after that? It doesn’t seem to say anything, and I get the feeling I am supposed to type. Something, after that.

---

<div class="post-metadata">

**Author:** ![Loudbeat](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/loudbeat/32/115975_2.png) [@Loudbeat](https://forum.choiceofgames.com/u/Loudbeat)\
**Post date:** [November 8, 2020, 2:42am UTC](https://forum.choiceofgames.com/t/way-to-test-errors-in-my-code/89401/9 "2020-11-08T02:42:31Z")

</div>

Sorry, I just assumed you knew about this, just try any of the following, or press enter after typing cmd or press run with the mouse

> **[10 Ways to Open the Command Prompt in Windows 10](https://www.howtogeek.com/235101/10-ways-to-open-the-command-prompt-in-windows-10/)**
>
> The Command Prompt has been around forever, and it’s still a great resource to have at your disposal. Today we’re showing you all of the different ways to open the Command Prompt. We’re betting you don’t know all of them.

---

<div class="post-metadata">

**Author:** ![LiliArch](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/liliarch/32/120749_2.png) [@LiliArch](https://forum.choiceofgames.com/u/LiliArch)\
**Post date:** [November 8, 2020, 2:50am UTC](https://forum.choiceofgames.com/t/way-to-test-errors-in-my-code/89401/10 "2020-11-08T02:50:28Z")

</div>

Command prompt is quite a powerful tool though… I’m not sure you should be using it if you don’t know what you’re doing.

At least be _very, very careful_.

---

<div class="post-metadata">

**Author:** ![will](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/will/32/132033_2.png) [@will](https://forum.choiceofgames.com/u/will)\
**Post date:** [November 11, 2020, 1:24am UTC](https://forum.choiceofgames.com/t/way-to-test-errors-in-my-code/89401/11 "2020-11-11T01:24:50Z")

</div>

One critique of both randomtest and quicktest is that neither display your variables when a bug is found.
