An Ultra simple Eagle PCB ULP User Language Program Tutorial to write to a file

Published by Fudgy McFarlen on

I like simple examples for purposes of learning a programming language.  Something that does not clutter everything up leaving me with a million doubts.  The following Eagle ULP tutorial file writes an ASCII string to two different files.  The first file write demonstrate the default location of file writing and the second shows how to specify where you want the file written.  Notice the backslash character needs escaped because it is the escape character!  

 


output("fudge.txt", "wt"){ printf("Directly printed to file with output statement\n");}           //w= Write new file / t= Text mode
                                                                                                  //This did not work when located at bottom of file. Must not have been executed.  
                                                                                                  //It writes to the Eagle program directory! 
output("C:\\Users\\freemonsandlewould\\Documents\\Schematics\\Reader\\ULP\\farge.txt", "wt")
      { printf("Directly printed to file with output statement\n");}          
                                                                                                  //The backslash character must be escaped with another backslash
                                                                                                  //When you specify the entire path then it goes where you plan that it should
      
exit (0);   // Must have this or it errors out


 

Categories: Eagle PCBElectronics

0 0 votes
Article Rating
Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
AMAR
AMAR
11 years ago

Hi

how to converts an nteger to a string caracter?

1
0
Would love your thoughts, please comment.x
()
x