# LoadError: LoadError: UndefVarError: ASCIIString not defined

**URL:** <https://discourse.julialang.org/t/loaderror-loaderror-undefvarerror-asciistring-not-defined/58885>\
**Category:** General Usage\
**Tags:** package\
**Created:** [April 8, 2021, 10:50pm UTC](https://discourse.julialang.org/t/loaderror-loaderror-undefvarerror-asciistring-not-defined/58885 "2021-04-08T22:50:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [April 8, 2021, 11:01pm UTC](https://discourse.julialang.org/t/loaderror-loaderror-undefvarerror-asciistring-not-defined/58885/2 "2021-04-08T23:01:12Z")

</div>

The reply on the post you link to is probably the best answer:

> [@ASCIIString not defined](https://discourse.julialang.org/t/asciistring-not-defined/9570/2):
>
> ASCIIString no longer exists in Base, so you are apparently using code from Julia 0.4 or earlier — it will need to be updated in several ways, probably. Just use the String, k.captures[1]. If you need to check that it is ASCII, use isascii. In the rare cases where you actually need an ASCIIString type, you can use the LegacyStrings package. Note that to upgrade code from an “ancient” version like Julia 0.4, it is best to first upgrade it to Julia 0.5, then upgrade it to Julia 0.6. This wa…

I encourage yo to try and work without ASCIISTRING. For example, as proposed in the answer, you could just use String and check if the string is ascii inside the function

```julia
function pinMode(file_des::SerialPorts.SerialPort , pin_no::Int64 , mode::String)
!isascii(mode) && throw("Mode needs to be ascii") #This will throw an error if mode is not ascii
  m = uppercase(mode) # Prevent errors due to case differences
  if m == "INPUT" str = "Da"*string(Char(48+pin_no))*"0" end # Dan0 for INPUT
  if m == "OUTPUT" str = "Da"*string(Char(48+pin_no))*"1" end # Dan1 for OUTPUT
  str = ascii(str) # Converts UTF8String to ASCIIString
  write(file_des,str)
end

```

If your code is composed of more functions, probably updating first to v0.5, then to v0.6 and v0.7. In particular v0.7 will tell you a lot of deprecation warnings to help you get your code ready for Julia v1.6

---

_[View the full topic](https://discourse.julialang.org/t/loaderror-loaderror-undefvarerror-asciistring-not-defined/58885)._
