Log In  


Hi Zep! 🙂

Apologies if this was already reported but I couldn't find anything. stat(6) returns an empty string if param_str begins with a special character:

cart.p8:

str = stat(6)

if (str == "") then
  print("oh no!")
else
  print("oh yeah!")
end

tty:

pico8 -p "-1" ./cart.p8
# oh no!

Thanks, wishing u a great week!! ✨



It seems like "-" specifically is a problem (its likely confusing the flag parser somehow)

possible workaround: if you're reading the param as local val = tonum(stat(6)), stick an extra space inside the quotes: pico8 -p " -1" ./cart.p8 (tonum ignores the space and val will be -1)


1

> its likely confusing the flag parser somehow

@pancelor that makes perfect sense and of course i didnt think to bother testing anything else 🤦‍♂️ thx for the workaround, i wouldnt have thought of that either! 🙌



[Please log in to post a comment]