I am having difficulty in writting to a file from within Jess. I have attached the Java and jess code below. The correct file name is created but no content is added. Thanks in advance Jeff Ruff ChipData
<<<<<Java>>>>> Rete reteo = new Rete(); String exportName = padStackName + ".txt"; File outputfile = new File(layoutSuite.expDir,exportName); FileWriter fw = new FileWriter(outputfile); reteo.addOutputRouter("fw", fw); <<<<<Jess>>>>>>>>>>> (import com.chipdata.jdb.*) (import com.chipdata.jdb.persistence.*) (import com.chipdata.jdb.persistence.eda.*) (import com.chipdata.jdbhandlers.*) (import com.chipdata.jdbutils.*) (import com.chipdata.jdb.jess.*) (import java.io.*) (load-package com.chipdata.jdb.jess.JDBJessExts) (printout t (jess-version-string) crlf) (printout t (watch all) crlf) (bind ?jdb (fetch JDB)) (bind ?pView (fetch VIEW)) (bind ?padStackName (fetch padStackName)) ;Get Package Content (bind ?pGroup (?pView findGroup "package")) (bind ?pPropCode (?pGroup findProperty "packageCode")) (bind ?pkgCode (?pPropCode getValue)) (printout fw "Package Code " ?pkgCode crlf) (bind ?pPropType (?pGroup findProperty "packageType")) (assert (pkgtype (?pPropType getValue))) (bind ?pkgType (?pPropType getValue)) (printout fw "Package Type " ?pkgType crlf) (bind ?pPropUnits (?pGroup findProperty "packageUnits")) (bind ?pkgUnits (?pPropUnits getValue)) (printout fw "Package Units " ?pkgUnits crlf) (assert (generate-pad)) ;Set rule for smt (defrule th-package (generate-pad) => (if (eq ?pkgType smd) then (printout fw "Surface mount padstack being created" crlf) else (printout fw "Through padstack being created" crlf) ) ) (run) -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] --------------------------------------------------------------------