• 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 Scripting - Skill
  3. Reading Values In Runtime Input File

Stats

  • Replies 1
  • Subscribers 18
  • Views 7447
  • Members are here 0
More Content

Reading Values In Runtime Input File

vimaldevlpr
vimaldevlpr over 4 years ago

Hi,

I want to print the values from the input file. In runtime file want to be select.

procedure(inpdata()
inp = axlDMFileBrowse(nil t ?optFilters "Input files|*.txt|")
fileparts = (axlDMFileParts inp)
inpnetname = nil
while(gets(BD_inp fileparts)
 BD_inp = car(parseString(BD_inp "\n"))
 when(BD_inp push(BD_inp inpnetname))
)
print(inpnetname)
)

I used this code shows me error. can any one please help me out this.

  • Cancel
  • Sign in to reply
Parents
  • DavidJHutchins
    DavidJHutchins over 4 years ago

    I made a few corrections to your code, please review what is shown below:

    \i (00:22:42) skill 'load("junk.ils")'
    (00:22:42) variable inpdata redefined
    (00:22:42) t
    \i (00:22:47) skill 'pp inpdata'
    (00:22:47) procedure(inpdata()
    (00:22:47) let((inp fileparts filePort inpnetname BD_inp)
    (00:22:47) (inp = axlDMFileBrowse(nil t ?optFilters "Input files|*.txt|"))
    (00:22:47) (fileparts = axlDMFileParts(inp))
    (00:22:47) (inpnetname = nil)
    (00:22:47) (filePort = axlDMOpenFile("ALLEGRO_TEXT"
    (00:22:47) cadr(fileparts) "r"
    (00:22:47) ))
    (00:22:47) while(gets(BD_inp filePort)
    (00:22:47) (BD_inp = car(parseString(BD_inp "\n")))
    (00:22:47) when(BD_inp
    (00:22:47) push(BD_inp inpnetname)
    (00:22:47) )
    (00:22:47) )
    (00:22:47) print(inpnetname)
    (00:22:47) axlDMClose(filePort)
    (00:22:47) )
    (00:22:47) )
    (00:22:47) nil
    \i (00:22:51) skill (inpdata)
    \i (00:23:00) fillin "junk.txt"
    (00:23:00) ("Clown" "The" "Bozo")
    (00:23:00) t

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • DavidJHutchins
    DavidJHutchins over 4 years ago

    I made a few corrections to your code, please review what is shown below:

    \i (00:22:42) skill 'load("junk.ils")'
    (00:22:42) variable inpdata redefined
    (00:22:42) t
    \i (00:22:47) skill 'pp inpdata'
    (00:22:47) procedure(inpdata()
    (00:22:47) let((inp fileparts filePort inpnetname BD_inp)
    (00:22:47) (inp = axlDMFileBrowse(nil t ?optFilters "Input files|*.txt|"))
    (00:22:47) (fileparts = axlDMFileParts(inp))
    (00:22:47) (inpnetname = nil)
    (00:22:47) (filePort = axlDMOpenFile("ALLEGRO_TEXT"
    (00:22:47) cadr(fileparts) "r"
    (00:22:47) ))
    (00:22:47) while(gets(BD_inp filePort)
    (00:22:47) (BD_inp = car(parseString(BD_inp "\n")))
    (00:22:47) when(BD_inp
    (00:22:47) push(BD_inp inpnetname)
    (00:22:47) )
    (00:22:47) )
    (00:22:47) print(inpnetname)
    (00:22:47) axlDMClose(filePort)
    (00:22:47) )
    (00:22:47) )
    (00:22:47) nil
    \i (00:22:51) skill (inpdata)
    \i (00:23:00) fillin "junk.txt"
    (00:23:00) ("Clown" "The" "Bozo")
    (00:23:00) t

    • 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