• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X PCB Editor
  3. need tips and examples for reading a text file

Stats

  • Replies 4
  • Subscribers 158
  • Views 15594
  • Members are here 0
More Content

need tips and examples for reading a text file

archive
archive over 17 years ago

I'm writing some axlSkill that reads the variants.lst file.
The statement xx = infile("variants.lst") opens the file for reading.
The statement gets(s xx) gets the first line written to a string object s.
Now I'm trying to use a getchar call to look at each character of the string and then decide what to do with the line. Specifically I'm looking for strings that start with "(" (for example).
I try getchar(s 1) == "(" hoping for a return value of t. But even though the first character of string s is ( the getchar call returns nil.
I'm guessing there is an easy way to parse a string and I haven't found it.
Help?


Originally posted in cdnusers.org by AshCan
  • Sign in to reply
  • Cancel
Parents
  • archive
    archive over 17 years ago

    getchar returns a character not a string so do
    getchar(s 1) == '\(

    also since a paren is special in Skill it needs to be escaped by a backslash, to match a 'd' all you would need is a 'd


    Originally posted in cdnusers.org by fxf
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • archive
    archive over 17 years ago

    getchar returns a character not a string so do
    getchar(s 1) == '\(

    also since a paren is special in Skill it needs to be escaped by a backslash, to match a 'd' all you would need is a 'd


    Originally posted in cdnusers.org by fxf
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information