# Help with following code

**URL:** <https://discourse.processing.org/t/help-with-following-code/2448>\
**Category:** Coding Questions\
**Created:** [August 7, 2018, 5:24pm UTC](https://discourse.processing.org/t/help-with-following-code/2448 "2018-08-07T17:24:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![KittyCatGamer123](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kittycatgamer123/32/1042_2.png) [@KittyCatGamer123](https://discourse.processing.org/u/KittyCatGamer123)\
**Post date:** [August 7, 2018, 5:24pm UTC](https://discourse.processing.org/t/help-with-following-code/2448/1 "2018-08-07T17:24:16Z")

</div>

I’m hoping anyone here could help me with this code.

> String gameIntro;  
> void setup() {  
> size(800, 600);  
> String save = loadStrings(“save1.txt”);  
> println(save);  
> gameIntro = save[0];  
> }  
> void draw() {  
> if (gameIntro == 0) { // I need it to be able to read this  
> }  
> }

KittyCatGamer123. 😉

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [August 7, 2018, 5:28pm UTC](https://discourse.processing.org/t/help-with-following-code/2448/2 "2018-08-07T17:28:11Z")

</div>

Which part of this is giving you trouble?

Please read this guide:

> [@Guidelines—Asking Questions](https://discourse.processing.org/t/guidelines-tips-on-asking-questions/2147):
>
> Summary (TL;DR) Ask complete questions to get better answers! Be specific. For example: I want to load an image. I tried using createImg() , and I expected the image to be on canvas, but what happened instead was the image showing up below the canvas. Isolate your problem and work in small steps. Share only the code directly related to your problem if it is part of a bigger project, and if something isn’t working, try the smallest code that could do the thing you want. Can we run your code to …

---

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [August 7, 2018, 5:34pm UTC](https://discourse.processing.org/t/help-with-following-code/2448/3 "2018-08-07T17:34:30Z")

</div>

Please format your code with the `</>` sign.  
You can edit your post by clicking the little pen on the bottom right corner of your post.

Concerning your problem, on this line: `if (gameIntro == 0)` you are trying to compare an integer value with a string variable. You can’t do that . You first need to convert your string into an integer.

Edit:  
You can actually check out this subject on how to convert a string into an integer: [Covert String to Integer](https://discourse.processing.org/t/covert-string-to-integer/2430/5)

---

<div class="post-metadata">

**Author:** ![KittyCatGamer123](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kittycatgamer123/32/1042_2.png) [@KittyCatGamer123](https://discourse.processing.org/u/KittyCatGamer123)\
**Post date:** [August 10, 2018, 2:54pm UTC](https://discourse.processing.org/t/help-with-following-code/2448/4 "2018-08-10T14:54:14Z")

</div>

Still no luck. Thanks for the \</\> sign though

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [August 10, 2018, 7:53pm UTC](https://discourse.processing.org/t/help-with-following-code/2448/5 "2018-08-10T19:53:50Z")

</div>

> [@KittyCatGamer123](#):
>
> Still no luck.

Please be more specific. Did you read the guide I posted above?
