Jump to content




Impossibly confused.


  • This topic is locked This topic is locked
16 replies to this topic

#1 applesauce10189

  • Members
  • 162 posts

Posted 13 January 2014 - 01:17 AM

So, I set the startup to say a different OS and to run my program. It only uses about 5 lines of code and my error is "bios:335: Expected string, string"

term.clear()
term.setCursorPos(1,1)
term.setTextColor(1024)
print("AppleOS V1")
os.run("turtledoor")


#2 applesauce10189

  • Members
  • 162 posts

Posted 13 January 2014 - 01:24 AM

Note: that os.run("turtledoor") line, I tried running it alone and it works fine so the problem is somewhere above it.

EDIT: I tried running turtledoor itself not the actual line of code.

Edited by applesauce10189, 13 January 2014 - 01:35 AM.


#3 Csstform

  • Members
  • 410 posts
  • LocationU.S.A.

Posted 13 January 2014 - 01:34 AM

I'm not sure about the part where you set the color, but whenever I use 'shell.run()' (the same as os.run()) I do not use quotation marks... I don't see any other problems.

#4 applesauce10189

  • Members
  • 162 posts

Posted 13 January 2014 - 01:40 AM

Removed quotation marks. Same error. I feel the quotation marks are optional because of this but it also could be the bios:335... error being triggered first.
Also changed term.setTextColor(1024) to term.setTextColor(colors.purple)
It wrote the "AppleOS" part but still didn't run the program.

EDIT: changed os.run(turtledoor) to use shell instead of os and now it ignores that line of code entirely, it literally printed AppleOS and didn't run the program. Also no error other than the fact it's ignoring the last line of code.

Edited by applesauce10189, 13 January 2014 - 01:43 AM.


#5 applesauce10189

  • Members
  • 162 posts

Posted 13 January 2014 - 01:45 AM

Okay, I put the quotation marks back and it's working perfectly.......... Seriously what the heck I changed almost nothing what was even causing this? I only changed two things to make this error go away, using shell instead of os and using colors.purple instead of 1024......... Wow...

#6 CometWolf

  • Members
  • 1,283 posts

Posted 13 January 2014 - 02:36 AM

Os.run and shell.run is not the same thing, and neither will work with an undefined variable. Os.run however also requires an enviroment along with the string path.

Edited by CometWolf, 13 January 2014 - 02:36 AM.


#7 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 13 January 2014 - 02:54 AM

Use shell.run() instead of os.run(). Never mind, missed that it was solved.

Edited by Kingdaro, 13 January 2014 - 02:55 AM.


#8 Buho

  • Members
  • 110 posts

Posted 13 January 2014 - 12:03 PM

I like the title: Impossibly Confused. Reminds me of the World's Most Interesting Man: He got confused once just to see what it was like.

Applesauce: a debugging tip: put error("X") or some other string after the first line. If the first line runs and you just get "X", then move it to under the 2nd line and repeat.

Alternatively, in your case, comment out all the lines except the first. Run. If all is fine, uncomment the second. Repeat.

#9 CometWolf

  • Members
  • 1,283 posts

Posted 13 January 2014 - 12:18 PM

A better idea in case of longer programs is check the functions of the api returning the error, which in this case is reffered to as "bios" and is thus any os. functions.

#10 OReezy

  • Members
  • 91 posts

Posted 13 January 2014 - 12:33 PM

Or having print() to check if it gets to a point is fine although sometimes slower.

#11 quique18c

  • Members
  • 8 posts

Posted 13 January 2014 - 12:57 PM

well try this :D!

at
term.setCursorPos(1,1)
it should be
term.setCursorPos(1, 1)
and change os.run to shell.run

it should be something like this

term.clear()
term.setCursorPos(1, 1)
term.setTextColor(1024)
print("AppleOS V1")
shell.run("turtledoor")


#12 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 13 January 2014 - 02:32 PM

This has already been solved. Argument spacing is a purely cosmetic choice and does not affect function.

#13 applesauce10189

  • Members
  • 162 posts

Posted 13 January 2014 - 10:30 PM

I do still have a question though, what was causing the error? As mentioned above, I used shell instead of os and I used colors.purple instead of 1024, I want to know so I can avoid it in the future because I remember running into this problem once before and rage quitting.

#14 Alice

  • Members
  • 429 posts
  • LocationBehind you.

Posted 13 January 2014 - 10:36 PM

I believe it's the use of shell.run over os.run.

#15 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 14 January 2014 - 12:56 AM

os.run requires an environment table as the first argument, which you were not providing.

#16 CometWolf

  • Members
  • 1,283 posts

Posted 14 January 2014 - 02:26 AM

View PostCometWolf, on 13 January 2014 - 02:36 AM, said:

Os.run and shell.run is not the same thing, and neither will work with an undefined variable. Os.run however also requires an enviroment along with the string path.
Im feeling pretty ignored right now...

#17 applesauce10189

  • Members
  • 162 posts

Posted 14 January 2014 - 05:22 PM

View PostCometWolf, on 14 January 2014 - 02:26 AM, said:

View PostCometWolf, on 13 January 2014 - 02:36 AM, said:

Os.run and shell.run is not the same thing, and neither will work with an undefined variable. Os.run however also requires an enviroment along with the string path.
Im feeling pretty ignored right now...
Don't worry you didn't go ignored by me, just impossibly confused me.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users